RE: setting unix command through perl script



i think this is not possible.

if you start a new process (shell) it gets the environment of its parent
process. but if you manipulate the environment in a child the parent will
not notice this..

for example

$ bash
$ export FOO=BAR
$ echo $FOO
BAR
$ exit
$ echo $FOO


Regards Martin


On 14:20:18 16/04/2008 <Irfan.Sayed@xxxxxxxxxxxxx> wrote:
I tried the line : $ENV{CCASE_NO_FILE_HEADER} = 'yes';

But still the value is not getting set.

Please help.

Regards,
Irfan

Project Lead
TSINDIA - Production Line
Individual Software Solutions - UMO
T-Systems India Private Limited, Pune
Telephone: +91-20-30245000/25605000 (Extn: 5271)
Mobile: +91 9822 854 227
Fax: +91-020 25674090
Internet: http://www.t-systems.com


-----Original Message-----
From: Rodrick Brown [mailto:rodrick.brown@xxxxxxxxx]
Sent: Wednesday, April 16, 2008 5:04 PM
To: Sayed, Irfan
Cc: beginners@xxxxxxxx
Subject: Re: setting unix command through perl script

On Wed, Apr 16, 2008 at 7:05 AM, <Irfan.Sayed@xxxxxxxxxxxxx> wrote:
Hi All,



I need to execute the "export CCASE_NO_FILE_HEADER=yes" command
through Perl script.



What I did is qx(export CCASE_NO_FILE_HEADER=yes); but still the
value for CCASE_NO_FILE_HEADER is not getting set to "yes"



Regards,

Irfan





With Perl you can get and set environment variables through using %ENV
ie. $ENV{FOO} = 'bar'

--
[ Rodrick R. Brown ]
http://www.rodrickbrown.com
http://www.linkedin.com/in/rodrickbrown

--
To unsubscribe, e-mail: beginners-unsubscribe@xxxxxxxx
For additional commands, e-mail: beginners-help@xxxxxxxx
http://learn.perl.org/

.



Relevant Pages

  • Re: Nothing is "Perfect"
    ... children would choose social nudism as an environment for their ... questions.......i think Anna is asking the right questions as a parent ... environment is not perfect then there is only one answer.....the ... hint that nudists might also have sex lives, ...
    (uk.rec.naturist)
  • Re: Nothing is "Perfect"
    ... questions.......i think Anna is asking the right questions as a parent ... environment is not perfect then there is only one answer.....the ... Peter & Jane: Totnes: South Devon ...
    (uk.rec.naturist)
  • The Founder Selection Effect
    ... ``The founders may represent a non-random sample of the ... may indeed require special qualities to be able to enter a new environment. ... The Darwinian fitness of each parent ...
    (sci.bio.evolution)
  • Re: NS and AaD curves
    ... If the environment changes, so does ... >> passed on from a parent to an offspring. ... for any gene to be able to be replicated ... offspring are fertile and not sterile) then the parent that reproduces the ...
    (sci.bio.evolution)
  • RE: alias in the shell
    ... then the parent could execute it. ... >> You can also get tricky by running your perl script in the current ... > shell script that sets up the environment, ... never modify the environment. ...
    (perl.beginners)