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).
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.