set enviorment varibale

  • Thread starter chinmoy.chittaranjan
  • Start date
C

chinmoy.chittaranjan

Hi All,

I am very new to perl .Actually i want to set a enviorment
variable thorugh perl script .
e.g.->set build =1;means this variable will be set by my perl script.
So could you please help on this matter ?

Your inputs are most welcome

Thanks
Chinmoy
 
G

Gunnar Hjalmarsson

I am very new to perl .Actually i want to set a enviorment
variable thorugh perl script .
e.g.->set build =1;means this variable will be set by my perl script.
So could you please help on this matter ?

$ENV{build} = 1;
 
J

Jens Thoms Toerring

I am very new to perl .Actually i want to set a enviorment
variable thorugh perl script .
e.g.->set build =1;means this variable will be set by my perl script.
So could you please help on this matter ?

As you has been told to set an environment variable assign to the
%ENV hash. But the way you write it I suspect that you want to set
an environment variable in the shell (or other process) you called
the script from, using that script. And that's something that can't
be done, you can only set an environment variable for the process
you're currently running (and for the child processes it may start
later) but never for its parent process, i.e. the process that
started the script.
Regards, Jens
 
C

chinmoy.chittaranjan

As you has been told to set an environment variable assign to the
%ENV hash. But the way you write it I suspect that you want to set
an environment variable in the shell (or other process) you called
the script from, using that script. And that's something that can't
be done, you can only set an environment variable for the process
you're currently running (and for the child processes it may start
later) but never for its parent process, i.e. the process that
started the script.
Regards, Jens
sorry for that if i sent 2 many messages before that beause i am
facing some problem regarding internet.
Too much Thanks Gunner ..it is working fine .But if i want to set this
enviorment variable to nothing (mean set build=1 to nothing)then what
procedure i have to follow?
 
G

Gunnar Hjalmarsson

Too much Thanks Gunner ..it is working fine .But if i want to set this
enviorment variable to nothing (mean set build=1 to nothing)then what
procedure i have to follow?

1. Enter "perldoc perlfunc".

2. Scroll downwards til you find a section with "Functions for real
%HASHes".

3. The function "delete" sounds promising, right? Enter
"perldoc -f delete" to get more info about it.

4. Yep, that seemed to be it. :)
 

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
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top