in reply to How hashes present keys and values.

boo,
I'm not an internals wiz to give you the reasoning for this (and there are people here who could), but the basic goes like this - order is not preserved putting items into the hash table for lookups, but both keys and values goes through the hash table in the same order.

Programming Perl from Larry, Tom, and our very own Randal published by O'Reilly under the entry for values (pg. 239) mentions "...it is the same order as either the keys or each function would produce...".

Hope this helps.
=Blue
...you might be eaten by a grue...

  • Comment on Re: How hashes present keys and values.