passing env to child processes

Keary Suska aksuska at webflyer.com
Thu Aug 30 13:46:38 CDT 2001


If I recall correctly, Perl should and does pass on it's environment,
because this can be a security issue with networked scripts. Depending on
your shell, you might have to "export" the environment for it to be
perpetuated through child processes, as long as you are using the shell to
invoke the subprocess. If you are bypassing the shell, I don't think you can
pass an environment. I.e., backticks and standard command pipes use the
shell, but system( $command, @params) does not, while system(
$command_n_parms) does.

Keary Suska
Esoteritech, Inc.
"Leveraging Open Source for a better Internet"

> From: "John Hundley" <johnh at fgm.com>
> Date: Thu, 30 Aug 2001 12:23:05 -0600
> To: "Pikes Peak PM's" <pikes-peak-pm-list at pm.org>
> Subject: passing env to child processes
> 
> Is there a way to ensure the environment gets passed on to child processes
> from Perl?  I am having a bit of trouble with this.  I thought this was done
> automatically but I guess not.  I tried a simple test by creating a shell
> script that sets up some environment variables then calls a Perl script that
> in turn calls another shell script which simply runs the env command.  This
> last script is not inheriting the environment of the initial shell script as
> I had hoped.
> Thanks,
> J
> 
> 




More information about the Pikes-peak-pm mailing list