| Module Info
| Add a review of Tie-IxHash
This is an awesome module.
I've known it for several years but overlooked its usefulness in the past and only started seriously using it this year.
It's amazing how much time it saved me so far and how it enabled me to write cleaner code in certain cases. I definitely recommend it.
An invaluable module that has saved me countless hours of time. Perl really should incorporate ordered hashes natively, but until then, this module saves the day.
I use this module often enough that I think it should be bundled with Perl.
There are really occassions when you want the order preserved. Consider the following snippet for XML special character conversion. You can now say:
tie (%escape_symbols, Tie::IxHash,
qq (&) => '&',
qq (\042) => '"',
qq (>) => '>',
qq (<) => '<'
Imagine using these key,value pairs in a regex for substitution. Here the order is vital, as the & signs needs to be replaced first, otherwise your routine might clobber over the & symbols you use for the other replacements!
Neat and simple package, that does exactly what it says it will do.
I only use it on rare occasions, but when I need it, it's great. It does exactly what it says: you get a hash that preserves order. Great!
If you need an ordered hash, this is the module for you. Very handy and well documented.