in reply to reseting PATH
I think it's safer to pass an argument.
Secondly, env $^X makes no sense. You want one of
Your other changes would indicate you want the last.
Thirdly, the changes to PERL5LIB look redundant with the paths built into the Perl you want to be running.
BEGIN { if (@ARGV && $ARGV[0] eq '--fixed') { shift(@ARGV); } else { $ENV{PATH} = join ':', '/mypath/perl/bin', $ENV{PATH}; delete $ENV{PERL5LIB}; exec '/mypath/perl/bin/perl', $0, '--fixed', @ARGV; die ...; } }
|
|---|