From: Mike Rylander Date: Wed, 23 Aug 2017 22:32:59 +0000 (-0400) Subject: LP#1527731: Force stable hash key ordering X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=c4c945b38c5ec48267bdebe959a21d5c6f7e5a4a;p=working%2FOpenSRF.git LP#1527731: Force stable hash key ordering Due to changes in Perl internals, some perl<->json assumptions no longer hold as of perl 5.18. This commit forces stable hash key generation and ordering so that some of our uses do not suffer. Signed-off-by: Mike Rylander --- diff --git a/bin/opensrf-perl.pl.in b/bin/opensrf-perl.pl.in index 40015e3..e20403d 100755 --- a/bin/opensrf-perl.pl.in +++ b/bin/opensrf-perl.pl.in @@ -14,6 +14,16 @@ # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # --------------------------------------------------------------- + +BEGIN { + #warn("Checking PERL_HASH_SEED...\n"); + if (!defined($ENV{PERL_HASH_SEED}) or $ENV{PERL_HASH_SEED} !=0) { + my $cmd = join(' ', 'PERL_HASH_SEED=0 /usr/bin/perl', $0, @ARGV); + #warn("Restarting with PERL_HASH_SEED=0: $cmd \n"); + exec($cmd) or die "Cannot exec"; + } +} + use strict; use warnings; use Getopt::Long; use Net::Domain qw/hostfqdn/;