in reply to hashes sorted by value, but displaying both keys and values
How about this?
for my $person (sort { $values{$a} <=> $values{$b} } keys %values) { print "$person\t$values{$person}", br(); }
Update: Removed incorrect dereferencing arrows and changed sorting scheme. I'd originally done this as a Schwartzian Transform before realizing that it was unnecessary. Less post, more sleep.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: hashes sorted by value, but displaying both keys and values
by Anonymous Monk on Dec 31, 2003 at 22:30 UTC | |
by chromatic (Archbishop) on Dec 31, 2003 at 22:50 UTC |