in reply to How to retrieve the worst value?

You could do something like this:

my $worst; my $max = 0; while ( my ( $key, $value ) = each %hash ) { if ( $value > $max ) { $worst = $key; $max = $value } } print "The worst process is $worst, with a time of $max minutes.\n";

This snippet assumes no two processes will take exactly the same length of time. However, if there are two that take the exact amount of time, only one of them will be shown. This may or may not be important to you.


Dave