in reply to Truly randomized keys() in perl 5.17 - a challenge for testing?

G'day saintmike,

What you're describing for 5.17 development versions, is a documented feature in the current (at time of writing) 5.18 production versions. See "perl5180delta: Hash overhaul".

You can emulate earlier behaviour with the environment variables PERL_HASH_SEED and PERL_PERTURB_KEYS. You might also look at PERL_HASH_SEED_DEBUG, which may be useful for your testing. [Note: I haven't looked at your test suite.]

Be aware of the security implications of modifying the hashing algorithm: "perlsec: Algorithmic Complexity Attacks".

See also: keys and Hash::Util.

-- Ken

  • Comment on Re: Truly randomized keys() in perl 5.17 - a challenge for testing?