in reply to Ordered Hashes

Others have mentioned the Tie::IxHash method for causing a hash to remember its insertion order. But I just wanted to mention what hasn't already been said: a Tie::IxHash should only be done after careful consideration of the fact that this approach carries with it some positives, and some negatives.

If you think of your consideration process as a balance sheet, on the positive side, you get an ordered hash. On the negative side, you get a less speed efficient and less memory efficient hash. You trade speed and memory for convenience. That may be a worthwhile trade for you. Or it might be a dealbreaker. Just as long as you're aware of the issues, you can make the right decision for your particular situation.


Dave


"If I had my life to live over again, I'd be a plumber." -- Albert Einstein