in reply to Re: setting PERL_PERTURB_KEYS & PERL_HASH_SEED in a perl file
in thread setting PERL_PERTURB_KEYS & PERL_HASH_SEED in a perl file
if( ! $ENV{PERL_PERTURB_KEYS} ) { $ENV{PERL_PERTURB_KEYS} = 1; $ENV{PERL_HASH_SEED} = ...; exec( $^X, $0, @ARGV ); die "Failed to exec self: $!\n($^X $0 @ARGV)\n"; } ... rest of Perl code ...
You can add the BEGIN block if you want to optimize away some wasted initialization work.
Note that this does not take care of options being passed to Perl by the user, for example, if the script is being invoked like "perl -Imylib -i.old script *.ds". In a more likely scenario, you wouldn't be able to debug the script by just doing "perl -d script ...".
- tye
In Section
Seekers of Perl Wisdom