If @data is large you may want to use a Schwartzian Transform (or other method of improving sort performance).foreach $junk (sort {$b->{'count'} cmp $a->{'count'} or $b->{'type'} cmp $a->{'type'}} @data) { print "$junk->{'count'} --> $junk->{'type'} --> $junk->{'a_point +'} -> $junk->{'z_point'} --> $junk->{'error'}\n"; }
BTW, @data would more properly be called a "list of hashes".
In reply to Re: how do I sort on two fields in a hash table?
by lhoward
in thread how do I sort on two fields in a hash table?
by vonman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |