my $max_count = 0; foreach my $key (keys %hash) { my $count = $hash{$key}; if ($count > $max_count) { $max_count = $count; } } foreach my $key (keys %hash) { my $count = $hash{$key}; if ($count == $max_count) { print "$key $count\n"; } }
In reply to Re: printing largest hash value
by sulfericacid
in thread printing largest hash value
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |