in reply to Retaining Insertion order throughout when using “map”
Typically, you would would just roll your own sort routine but it sounds like you want to automagically have the hash come out in the order you want regardless of when and how you modify the hash. At the cost of a little performance and memory, you can use my module Tie::Hash::Sorted to accomplish this.
Check out the example sort routine. It determines the order of one hash by the value of another hash. If you have a hard time using the module to accomplish what you want, let me know and I will attempt to help further.
Cheers - L~R
|
|---|