Steve Main wrote:
> Hello list,
> 
> Does anyone know how to set an environment variable in Perl and then
> have that variable persist after the Perl script has ended?
> 
> I'm working in Unix.

Really can't be done. A process cannot change its parent's environment.

There are various hacks that can be done. For example, if your Perl script
were to write the following output to its stdout:

   MYVAR=value

Then you could 'set' this variable in the shell (assuming Bourne-style
shell) by:

   eval `myscript.pl`

Any similar technique will rely on the child communicating back to the
parent in some fashion and then the parent actually changing the
environment.

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to