in reply to LD_LIBRARY_PATH setting
On most operating systems, $^X contains the full path to the perl executable used to run your script, so you should not need to involve env.
Your approach is the correct approach to restart your Perl script with added parameters, but you need to add one more parameter that indicates that your Perl script has restarted itself already:
BEGIN { if( ! $ENV{PDUPRE_RESTART}) { $ENV{LD_LIBRARY_PATH} = '...'; $ENV{PDUPRE_RESTART} = 1; exec $0, '--restarted', @ARGV }; }; ...
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: LD_LIBRARY_PATH setting
by pdupre (Acolyte) on Aug 05, 2016 at 18:40 UTC | |
by Corion (Patriarch) on Aug 05, 2016 at 19:00 UTC | |
by pdupre (Acolyte) on Aug 05, 2016 at 19:08 UTC | |
by Corion (Patriarch) on Aug 05, 2016 at 19:14 UTC | |
by pdupre (Acolyte) on Aug 05, 2016 at 19:22 UTC | |
|