When I run your version of the BEGIN code, I get
where lines 68 and 73 are:Use of uninitialized value in string eq at /apps/bin/blah/reconcile_wi +thdotsh.pl line 68. main::BEGIN() called at /apps/bin/blah/reconcile_withdotsh.pl +line 73 eval {...} called at /apps/bin/blah/reconcile_withdotsh.pl lin +e 73
It isn't __FILE__ that is the uninitialized value (as I put a print command in), so presumably its the "$ENV{ +__FILE__ }" but I can't manage to print that to check - and being in a BEGIN statement I can't step through it in debug.67 BEGIN { 68 unless( $ENV{ +__FILE__ } eq __FILE__ ){ 69 delete $ENV{LIBPATH}; 70 $ENV{ +__FILE__ } = __FILE__; 71 exec $^X, __FILE__, @ARGV; # relaunch without LIBPATH 72 } 73}
Also, in both versions the script just ends (as opposed to terminating with an error).
Maybe I should be a heretic and go back to using COBOL on a mainframe! Do any still exist?
Cheers
Kev
In reply to Re^9: replicating the command 'unset LIBPATH' in perl
by viffer
in thread replicating the command 'unset LIBPATH' in perl
by viffer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |