My question has been discussed here
setting enviornment variables for parent process, but I'm still unclear as to the answer.
Over coffee this morning, a DBA friend of mine asked my advice about a problem she is having. She has a program called "oraenv", that among other things, needs to read an environmental variable, ORAHOME, in order to run. Her problem is that the variable needs to persist after the program is finished running. Her current solution is to run it from ksh, ". oraenv -d <orahome>".
Her question to me was, "Can I do this in Perl?" She wants to write a program in Perl, which will run "oraenv" and also interact with her database. For this, and several other reasons, she needs a solution using Perl.
This entry in
perlfaq8 describes how this *could* be done, but I am not really experienced enough to fully understand what is described there. It has been my understanding that no child process could modify its parent's environment. Period.
But,
this seems to intimate that I am wrong.
Any ideas how to accomplish this using Perl? I understand why
system, backticks and
exec aren't the answer(s).