in reply to Re: cgi input
in thread cgi input

Perhaps you misunderstand the "random hash change".

A hash will always have an internal ordering. As long as you aren't adding new keys, the keys and their values can be accessed by any of: (1) hashname in a list context, (2) each(), (3) keys(), and (4) values(), and the lists will remain consistent.

What got changed is how a given set of keys gets set into that order. Each time a new hash is created, a random value is associated with that hash, and it perturbs the hashing algorithm so that the ordering is mostly unpredictable.

So, existing programs that call keys() and values() in parallel can still work. What won't work is expecting the same set of keys in a new hash to be the same order as an old hash.

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

  • Comment on Random Hash Understandings (was Re: Re: cgi input)