Re: environment inheritance..

From: Joe Smith (joe_at_inwap.com)
Date: 03/08/05


Date: Tue, 08 Mar 2005 02:03:23 -0800

ktom wrote:
> when executing a 'system( some_other program );' from within a perl
> script the environment it inherits, specifically the path, is unexpected.

Unless you've explicitly done something with %ENV, programs invoked
by system() have the same environment as when the perl script was
started from the command line.

If your perl script is being run some other way, such as by cron
or apache, it won't have the same environment as when run from the
command line. In such case, it is up to the author of the script to
make sure that $ENV{PATH} is correct.

Have you ever entered "perldoc -q environment" at the command line?
Any further questions should be posted to comp.lang.perl.misc
instead of here.
        -Joe



Relevant Pages

  • Re: user id validation
    ... I have not tried like that but I feel it can be done because the environment ... Rajnikant Jachak | Software Engg | Persistent Systems Limited ... I am just wondering how to validate a user who is using the script?? ... there specific perl command for that? ...
    (perl.beginners)
  • Re: Script export problem in FC3
    ... > I need to modify the PATH environment using a script. ... > If I run the export command in command line I have no problem, ... The child process has the new environment, ...
    (Fedora)
  • Re: process control
    ... command so that it completes before moving on to the next process. ... > three sibling processes then they will inherit their environment from ... modified my environment} in a perl script. ...
    (comp.lang.perl.misc)
  • Re: rm -r /usr/local by mistake
    ... (i.e. act the _same_ way, for the same invocation, in any environment). ... In the non-interactive language there is *no* "rm' command, ... So in a noninteractive script, ... Do you understand that "would have to specify the 'non-interactive' flag" ...
    (comp.unix.bsd.freebsd.misc)
  • Re: Help with system seeming to return too soon...
    ... >>install script. ... > a new process, sets the environment variables in that process, then ... I can on the command line) that I could get around this problem. ...
    (comp.lang.perl.misc)