How will your Perl program know that it has already re-executed itself?
My approach would be to set a second environment variable to tell your program that it is already re-executing:
warn "$0 launched"; if (! $ENV{RE_EXECUTING}) { $ENV{RE_EXECUTING} = 1; warn "Set up environment. Re-executing now."; exec ... };
But maybe you want to just check whether the environment needs changing at all, and only if you need changes re-execute?
In reply to Re: reseting PATH
by Corion
in thread reseting PATH
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |