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

It's not necessary to use the shell to set a variable. Just:
$ENV{PEOPLE}=5033;
should suffice.

Replies are listed 'Best First'.
Re^3: Problems with Setenv within Perl
by gmpassos (Priest) on Jul 21, 2004 at 20:39 UTC
    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".

      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.