in reply to Setting env vars in current process

That sentence in perlvar does not mean "changing %ENV only changes the environment of all children", it's more like "note that this will change the envirnonment of all your children".

Relax and test it, %ENV represents the current environmental variables of your process, without caveats.

#!/usr/bin/perl $ENV{FOO} = 1; print "\$ENV{FOO} is $ENV{FOO} still\n"; exec( '/usr/bin/env' );

The output of env will also mention "FOO" being "1".

--
http://fruiture.de

Replies are listed 'Best First'.
Re: Re: Setting env vars in current process
by ruscoekm (Monk) on Feb 11, 2003 at 19:29 UTC
    Ok, thanks. That's what I thought. I must be missing something else then (see reply above). Will reply if/when I find out!