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";