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
In reply to Re: Sort by value - new twist
by VSarkiss
in thread Sort by value - new twist
by shemp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |