http://qs321.pair.com?node_id=433288


in reply to printing largest hash value

my %hash=(); my $highest; my @highest=grep {defined $highest ? $hash{$_}==$highest : (($highest= +$hash{$_}),1) } sort { $hash{$b} <=> $hash{$a} || $a cmp $b } keys %hash;

or

my %hash=(); my %rev; my $highest=0; for (keys %hash) { $rev{$hash{$_}}{$_}++; $highest=$hash{$_} if $highest < $hash{$_}; } print sort keys %{$rev{$highest}};
---
demerphq