Handling Environmental variables

S

Satish

Hi,

How do I set/unset unix environmental variables from a perl script?

thanks,
Satish
 
J

J. Gleixner

Satish said:
Hi,

How do I set/unset unix environmental variables from a perl script?

It's 'environment' variables. You operated on %ENV.

$ENV{'PATH'} .= ':/some/other/path';

foreach my $var (keys %ENV)
{
print $var, ':', $ENV{$var}, "\n";
}
 
G

gnari

J. Gleixner said:
It's 'environment' variables. You operated on %ENV.

$ENV{'PATH'} .= ':/some/other/path';

foreach my $var (keys %ENV)
{
print $var, ':', $ENV{$var}, "\n";
}

unless the OP is referring to

perldoc -q environment

gnari
 
J

Jürgen Exner

Satish said:
How do I set/unset unix environmental variables from a perl script?

"perldoc perlvar" and check the %ENV hash.
"perldoc -q environment" might be interesting, too.

jue
 
S

Satish

J. Gleixner said:
It's 'environment' variables. You operated on %ENV.

$ENV{'PATH'} .= ':/some/other/path';

foreach my $var (keys %ENV)
{
print $var, ':', $ENV{$var}, "\n";
}
Thanks this helped.
Satish
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,156
Messages
2,570,878
Members
47,404
Latest member
PerryRutt

Latest Threads

Top