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.
In reply to Re: hashes sorted by value, but displaying both keys and values
by chromatic
in thread hashes sorted by value, but displaying both keys and values
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |