I have a hash which contain netflow statistic data. And I want to sort it by total number of packets and total size.
My code is like this:
%flows = sort {$flows{$b}{pkts} <=> $flows{$a}{pkts} or $flows{$b}{size} <=> $flows{$a}{size} } %flows;
But why not it work normal? What's wrong with it?
thanks!In reply to How to sort HASH? by iwanthome
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |