Welcome to the Monastery | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
If you're using $Area as the key to your hash
my @sorted_areas = sort { $a <=> $b } keys %NetAreaHash will sort them in ascending order (swap $a and $b if you prefer descending). If you're going to follow xdg's advice and have $Area as the value of the hash, use my @sorted_areas = sort { $NetAreaHash{$a} <=> $NetAreaHash{$b} } keys %NetAreaHash Again, swap $a and $b for descending. As to your main problem, I have discovered a truly remarkable solution which this textbox is too small to contain (tm) :-) In reply to Re: Sorting hashes...
by FunkyMonk
|
|