Page 661 of Camel III states:
"Setting a value in %ENV changes the environment for both your process and child processes..."
However, perlvar(1) for both v5.6.1 and v6.8.0 both state:
"Setting a value in ENV changes the environment for any child processes you subsequently fork() off."
It appears from my testing as though setting %ENV does not change the current process, at least on Solaris.
My questions are:
1) Can somebody confirm the expected behaviour? Is it platorm-specific, or does this never work?
2) If it does not work, why not? To put it another way, why should Perl not support changing the environment of the current process?
3) If it does not work, I need a workaround. Wrapping each of my Perl programs in a shell script which sets the environment seems messy. I used to require users to source an environmental setup script, but this polluted their environment unnecessarily. All ideas welcome.
Cheers Kevin
In reply to Setting env vars in current process by ruscoekm
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |