I'm not really familiar with Perl, but I've been searching in the documentation and other sources without success for the last 2 days. In the documentation, it is written:
Perl v5.18 includes support for multiple hash functions, and changed the default (to
ONE_AT_A_TIME_HARD
), you can choose a different algorithm by defining a symbol at compile time. For a current list, consult the INSTALL document. Note that as of Perl v5.18 we can only recommend use of the default or SIPHASH. All the others are known to have security issues and are for research purposes only.
The thing is that neither in INSTALL document nor in other sources/sites etc. I can find how to define this symbol.
What I want to do is to change the default ONE_AT_A_TIME_HARD
hash function to ONE_AT_A_TIME_OLD
so I can simulate the old Perl 5.16 behavior.
This sounds like an XY problem. What are you trying to accomplish by forcibly downgrading the hash algorithm in perl to one that has known problems?
From comments:
Whew, that's bad news. Find those developers, and hit them around the head with a copy
perldata
:Specifically - if this is a problem for you, it means your codebase treats hashes as ordered, when they aren't and never were. (It's just they were fairly consistent before 5.18 and more random after).
From
perldelta
:See: http://blog.booking.com/hardening-perls-hash-function.html
To answer your question - if you really must:
But it's a very very bad idea, because as the
INSTALL
file in your perl source package points out:By building your
perl
this way you introduce a known security flaw for everyperl
program using it.Note -
ONE_AT_A_TIME_HARD
is the new default, so this won't change how perl 5.18 works. You may meanPERL_HASH_FUNC_ONE_AT_A_TIME_OLD