in reply to Sort by value - new twist
This is untested, but it seems like you should be able to do something like:
In other words, pass a reference to the hash to the sort function.sub mysort { $_[0]->{$a} cmp $_[0]->{$b} } # ... later ... for my $key (sort mysort(\%hash), keys %hash) { # and so on
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Sort by value - new twist
by shemp (Deacon) on Sep 01, 2004 at 19:27 UTC |