set enviorment varibale
am 20.08.2007 11:47:42 von 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
Re: set enviorment varibale
am 20.08.2007 12:01:54 von Gunnar Hjalmarsson
chinmoy.chittaranjan@gmail.com wrote:
> 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;
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
Re: set enviorment varibale
am 20.08.2007 17:10:41 von JT
chinmoy.chittaranjan@gmail.com wrote:
> 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
--
\ Jens Thoms Toerring ___ jt@toerring.de
\__________________________ http://toerring.de
Re: set enviorment varibale
am 20.08.2007 20:46:35 von chinmoy.chittaranjan
On Aug 20, 8:10 am, j...@toerring.de (Jens Thoms Toerring) wrote:
> chinmoy.chittaran...@gmail.com wrote:
> > 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
> --
> \ Jens Thoms Toerring ___ j...@toerring.de
> \__________________________ http://toerring.de
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?
Re: set enviorment varibale
am 20.08.2007 22:56:43 von Gunnar Hjalmarsson
chinmoy.chittaranjan@gmail.com wrote:
> 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. :)
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl