in reply to Set shell environment variables from within a perl script
This would also change the environment of your perl program itself, and would hence be propagated to all other child processes; most likely, this is what you want to do in the special case of CVSROOT, isn't it?ENV{CVSROOT}="...";
The other possibility (assuming that you always shell out to bash, or ksh, or zsh), would go like this: Assume that you want to call an external program myprog with CVSROOT set to a special value, you could use
This is useful if you want the change of the environment only for that particular call.system('CVSROOT="...." myprog myarguments');
|
|---|