http://qs1969.pair.com?node_id=1147965


in reply to Sorting a hash in a predetermined order

I would like to order the output in the order in which I fill the hash as listed above...

That kind of sounds like you're wanting an ordered hash. My first thought on that was Tie::IxHash. In looking for the link for that module, I stumbled across another module that does something similar and it had a link to yet another module (Hash::Ordered). The documentation for Hash::Ordered has links to other similar modules as well as some benchmarks run by its author comparing the different modules that provide an ordered hash.

Of course, based on your full description, I'm thinking that choroba's suggestion would be what I probably would go with.

  • Comment on Re: Sorting a hash in a predetermined order