in reply to Re: hash sort by the values and get the keys
in thread hash sort by the values and get the keys

Or:

for my $key (sort {$hash{$a} <=> $hash{$b}} keys %hash) { print "$key: $hash{$key}\n"; }

or maybe even:

print "$_: $hash{$_}\n" for sort {$hash{$a} <=> $hash{$b}} keys %hash;

True laziness is hard work