May 9, 2013, 1:59 AM
Post #4 of 4
Re: [lsy] set an unix alias from perl script
[In reply to]
What do you really want to do?
If you want to use a Perl script to modify permanently the parent Unix environment, I am afraid this can't be done in Perl.
If you want to modify an environment variable for later use in your Perl program, you can modify the %ENV hash for the particular environment variable that you want to modify.
i want to set an alias in my environment. is it possible?
You did not really answer the questions.
It is possible to modify your own execution environment (and the environment of subprocesses or threads that you may start off), but it is not possible to modify the parent environment, because, in *nix, your process is essentially running in a copy of the parent environment. Whenever you change the environment, you alter your own copy of the environment, but never the parent environment itself.