John W. Krahn wrote:
It is very easy to change the directory from inside a Perl program
however as soon as the program exits the changes will be lost.  This is
true of Perl or C or Bash or anything that runs as a child of the
shell.  A child process cannot change its parent's environment.

This would not solve the OP's problem of course, but I'd like to point out that when one wants a process to set the parent's environment, and the parent is a shell, one usually does this:


$ eval `COMMAND`

An example of COMMAND would be ssh-agent, which outputs:

 SSH_AUTH_SOCK=/tmp/...
 SSH_AGENT_PID=...

The output then gets eval-ed by the shell and becomes part of the shell's environment.

--
dave


-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to