Syntactic Confectionery Delight | |
PerlMonks |
Re: Cutting the top percentage out of a Hashby ikegami (Patriarch) |
on Apr 13, 2006 at 18:38 UTC ( [id://543178]=note: print w/replies, xml ) | Need Help?? |
The hash is sorted in a specific order, That's impossible. Hashes can't be sorted, as you've noticed. Are you sure an AoA isn't more appropriate here? If you wish to continue using a hash, the typical solution it the sort the data as you read it from the hash, as follows:
Alternatively, you could use Tie::IxHash instead of a hash. You use it just like a normal hash (thanks to tie), but the contents are ordered.
In Section
Seekers of Perl Wisdom
|
|