RE: How to set environment variable
- From: perlpra@xxxxxxxxx (Siva Prasad)
- Date: Fri, 28 Sep 2007 11:21:04 +0530
Hi Vikram,
You are not able to access the env variable coz it is not set as you have
wished.
Do like the following.
Set environment variable using export.
export HAI=hai
and print the from your perl script.
The above command sets the environment variable in your system EVN variables
and you can use the same env variable in all subshells.
This works.
Hth,
Regards,
PP.
-----Original Message-----
From: vikram vikram vikram [mailto:vicky_brsh@xxxxxxxxxxxxxx]
Sent: Thursday, September 27, 2007 8:18 PM
To: beginners@xxxxxxxx
Subject: How to set environment variable
Hi All,
I am new to perl. I am using "Active Perl-5.8.8"
I want to set environment variable in a perl script
Ex - #!/usr/bin/perl
$ENV{HAI} = "hai";
and want to display the contents of the environment
variable in the command line after executing the script.
But it is not displaying the contents if i give
echo $HAI
Please help me out
Thanks in advance
Vikram
.
- References:
- How to set environment variable
- From: Vikram Vikram Vikram
- How to set environment variable
- Prev by Date: Re: Re: How to set environment variable
- Next by Date: Re: encoding problem?
- Previous by thread: Re: How to set environment variable
- Next by thread: Re: How to set environment variable
- Index(es):
Relevant Pages
|
|