in reply to Sorting a hash by values...
print map {qq{$_ is $age{$_} years old\n}} sort {$age{$b} <=> $age{$a}} keys %age;
I hope this is of use.
Cheers,
JohnGG
Update: Added missing closing brace in map, thanks Hue-Bond. That's what comes of hasty posting after too much beer :(
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Sorting a hash by values...
by chinamox (Scribe) on Oct 10, 2006 at 09:30 UTC |