| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> c.d.o.server -> Re: Setting the env. / oraperl question
[ Followups trimmed. Nothing specific to Oracle in here. ]
Jared Hecker (jhecker_at_iago.nac.net) wrote:
: I am planning a script that will have to:
: 2. change an environmental variable and do some work (loop iteration 1,
: ENV=xxx, run scripts; loop iteration 2, ENV=yyy, run scripts; etc.).
: My question is, when I set an environmental variable from perl and then
: use a system call to run another app (in this case SQL*Plus), does the
: environmental variable setting hold for the called app's environment?
: (If it's convenient, e-mail will reach me faster.)
If it's convenient, writing four lines of code to see what happens would have answered your question in less than a minute:
$ENV{foo} = 'foo';
system 'echo $foo' and die 'problem running system()';
$ENV{foo} = 'FOO';
system 'echo $foo' and die 'problem running system()';
output:
foo
FOO
--
Tad McClellan SGML Consulting
tadmc_at_metronet.com Perl programming
Fort Worth, Texas
Received on Fri May 21 1999 - 04:02:00 CDT
![]() |
![]() |