At Ask Me Help Desk you can ask questions in any topic and have them
answered for free by our experts. To ask questions or participate in
answering them you must register for a free account. By registering you
will be able to:
Get free answers from experts in any of our 300+
topics.
Is it possible to save the environment variable that Perl modified after the Perl program ends.
example
I want to use the PATH that my Perl script set as my unix PATH.
I don't claim to be a perl expert but I can't think of a way to do this. When perl closes it's environment and memory is discarded. If you had perl output the values you wish to use you could capture them and set them external to the perl script but this may be messy. For things like ksh or bash you would do this like:
. scriptWhichSetsPath
But I am pretty sure this won't work for a perl script. scriptWhichSetsPath is read line by line and executed in the current shell.
If you want to try to output the result and handle it in the script that called the perl code let me know and I can try to help you with that.