I also use this type of solution under certain circumstances. The Tie::IxHash module (tied hash) takes care of storing it both ways, it keeps track of the insertion order into the hash
I use the most powerful debugger available: print!
Comment on Re^2: To Hash or to Array--Uniqueness is the question.