in reply to Re: sorting a hash
in thread sorting a hash
The OP doesn't state this clearly, but I assume that he means numerically sorted, rather than lexically.
print "$_\t$hash{$_}\n" for reverse sort { $a <=> $b } keys %hash; # or simply print "$_\t$hash{$_}\n" for sort { $b <=> $a } keys %hash;
|
|---|