in reply to Re^8: replicating the command 'unset LIBPATH' in perl
in thread replicating the command 'unset LIBPATH' in perl
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^10: replicating the command 'unset LIBPATH' in perl
by ikegami (Patriarch) on May 19, 2010 at 06:55 UTC | |
by viffer (Beadle) on May 20, 2010 at 00:32 UTC | |
by Anonymous Monk on May 20, 2010 at 02:07 UTC |