export system environment variables within PERL
export system environment variables within PERL
am 11.09.2004 21:45:13 von hastenthunder
Hi gurus,
I need to be able to set Linux's environment variable within a PERL script.
The Linux command to set environment variable is "export".
So I tried to set it using the system() command:
system('export ORACLE_SID = TEST');
But that did not seem to work, the script just continues to execute without
actually changing the environment variable.
Any help would be greatly appreciate!
Gordon
Re: export system environment variables within PERL
am 12.09.2004 12:52:23 von Tintin
"hastenthunder" wrote in message
news:eBI0d.1230$Ny6.2370@mencken.net.nih.gov...
> Hi gurus,
>
> I need to be able to set Linux's environment variable within a PERL
script.
> The Linux command to set environment variable is "export".
> So I tried to set it using the system() command:
>
> system('export ORACLE_SID = TEST');
>
> But that did not seem to work, the script just continues to execute
without
> actually changing the environment variable.
>
> Any help would be greatly appreciate!
$ENV{ORACLE_SID} = 'TEST';
Re: export system environment variables within PERL
am 13.09.2004 00:15:11 von Gary Yates
Try looking up ARGV you should find your answer there.
ARGV is used for environment variables, as well as command line arguments.
"hastenthunder" wrote in message
news:eBI0d.1230$Ny6.2370@mencken.net.nih.gov...
> Hi gurus,
>
> I need to be able to set Linux's environment variable within a PERL
script.
> The Linux command to set environment variable is "export".
> So I tried to set it using the system() command:
>
> system('export ORACLE_SID = TEST');
>
> But that did not seem to work, the script just continues to execute
without
> actually changing the environment variable.
>
> Any help would be greatly appreciate!
>
> Gordon
>
>
Re: export system environment variables within PERL
am 13.09.2004 11:08:41 von Tintin
"Gary Yates" wrote in message
news:aiue12-24k.ln1@rowdy02.myhome.cxm...
> "hastenthunder" wrote in message
> news:eBI0d.1230$Ny6.2370@mencken.net.nih.gov...
> > Hi gurus,
> >
> > I need to be able to set Linux's environment variable within a PERL
> script.
> > The Linux command to set environment variable is "export".
> > So I tried to set it using the system() command:
> >
> > system('export ORACLE_SID = TEST');
> >
> > But that did not seem to work, the script just continues to execute
> without
> > actually changing the environment variable.
>
> Try looking up ARGV you should find your answer there.
>
> ARGV is used for environment variables, as well as command line arguments.
I'd love to see you give an example of using the ARGV array for environment
variables, because it's impossible.
Re: export system environment variables within PERL
am 14.09.2004 10:17:56 von Joe Smith
Gary Yates wrote:
> Try looking up ARGV you should find your answer there.
>
> ARGV is used for environment variables, as well as command line arguments.
You're wrong there. (argv,argc,envp) != ARGV.
-Joe