my %hash = ( ... ); my @sorted_keys = sort { $hash{ $a } <=> $hash{ $b } } keys %hash; print $_, " ", $hash{ $_ }, "\n" foreach ( @sorted_keys );
Update fixed terminology
----------------------------------------------------- Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The BrainIn reply to Re: How to sort a hash by its values?
by Masem
in thread How to sort a hash by its values?
by supernewbie
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |