Keith Thompson said:
But a child process can certainly modify its own environment in
response to the output of something it invokes.
But then it is acting as a new parent process, not as a child process.
If you want to split hairs, then I should rephrase my answer as:
You set the value in the hash %ENV. But that doesn't do you any good
because it sets the value in the currently running Perl process, not in
the calling shell process. If you want to modify the value of the shell
variable in a parent process directly from the child process than it
cannot be done.
The workaround suggested in "perldoc -q env" requires the Perl script
to generate a shell command to be evaluated, but that's not necessary.
[example snipped]
True, but all of that is some magic on the shell side and applies to any
process called by the shell in any programming language and therefore
doesn't have anything to do with Perl and that's why the answer in the
Perl FAQ points you to the documentation and FAQ for whatever shell you
are using.
jue