Forum Moderators: coopster & phranque
I know there are lots of Perl tricks and wonder if there is one for this.
As an example, say:
$hasharray{"turnips"} = 9 $hasharray{"swedes"} = 3 $hasharray{"carrots"} = 95
What is the easier way to find carrots?
Cheers
my @sorted = sort {$hasharray{$b} <=> $hasharray{$a}} keys %hasharray; print $sorted[0];