in reply to How to retrieve the worst value?
No need to sort or transfer values to an array
use List::Util qw[ reduce ]; my $worstKey = reduce{ $hash{ $a } < $hash{ $b } ? $a : $b } keys %hash; print "The worst is $worstKey with a time of $hash{ $worstKey } minute +s";
|
|---|