in reply to Re^2: Problems with Setenv within Perl
in thread Problems with Setenv within Perl

Yes, setting the value of %ENV will automatically set the enverioment variable outside the process, and after the process die it will restore the previous values.

Note that some keys can't be set, for example, on Win2K we can't set wrong keys like PATH, PATHEXT e HOMEPATH. But if you are just setting a new key it will work just fine.

Graciliano M. P.
"Creativity is the expression of the liberty".

Replies are listed 'Best First'.
Re^4: Problems with Setenv within Perl
by sgifford (Prior) on Jul 22, 2004 at 01:09 UTC

    That seems like a confusing way to look at it. At least under Unix, setting %ENV will set the environment variable in the running Perl process. That environment is inherited by all processes which are started from that process. The environment is never "changed back"; when the process exits, its environment goes away with all of its other data.