![]() |
|
Think about Loose Coupling | |
PerlMonks |
How to change a script's environment after the script is already run, based on shell sourcing ?by ronbarak (Novice) |
on Sep 28, 2006 at 08:28 UTC ( #575303=perlquestion: print w/replies, xml ) | Need Help?? |
ronbarak has asked for the wisdom of the Perl Monks concerning the following question:
Hi, I have a Perl script that relies on $ENV{'ORACLE_HOME'}. However, it may be that the account I run the script under has not set $ORACLE_HOME. The setting of $ORACLE_HOME in the shell is performed by executing (sourcing) the following in .bashrc of the account: . /etc/profiles/bashrc.ora.v.10 (it contains lines like: "<b>export ORACLE_BASE=/oracle</b> and <b>export ORACLE_HOME=$ORACLE_BASE/v10.2.0</b> depending on the Oracle version). My question is, how can I source '/etc/profiles/bashrc.ora.v.10' in my Perl script, and have the results inserted in the script's current environment ? Note: I cannot just write $ENV{ORACLE_HOME}='/oracle/v10.2.0' ;, as the Oracle version is not known to my script. Thanks, Ron.
Back to
Seekers of Perl Wisdom
|
|