Turn the hash inside-out, then sort the keys in descending order and pick the first.
my %hash = (processone => 1, processtwo => 0.005, processthree => 3) +; my %hash2 = map {$hash{$_} => $_} keys %hash; my $worst = (reverse sort keys %hash2)[0]; print "the worst process is $hash2{$worst} with a time of $worst min +utes\n";
In reply to Re: How to retrieve the worst value?
by pbeckingham
in thread How to retrieve the worst value?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |