http://qs321.pair.com?node_id=543183


in reply to Re: Cutting the top percentage out of a Hash
in thread Cutting the top percentage out of a Hash

ikegami,
Alternatively, you could use Tie::IxHash instead of a hash. The syntax is the same (thanks to tie), but the contents are ordered.

It should be made clear that the order is the insertion order and not an arbitrary sort criteria. While the module does provide rudimentary sort capability, it is limited to asciibetical sorts of the keys or values.

Tie::Hash::Sorted may be a better fit.

Cheers - L~R