RE: setting unix command through perl script



I want to execute "export CCASE_NO_FILE_HEADER=yes" command in Perl
script.
If I run this command on bash prompt then it is executing properly but
if I try to execute this command through perl script then it is not
executing at all

How should I achieve this . is there any another way.

Please help.

Regards,
Irfan

-----Original Message-----
From: Kenneth Wolcott [mailto:kennethwolcott@xxxxxxxxx]
Sent: Thursday, April 17, 2008 12:05 AM
To: beginners@xxxxxxxx
Subject: Fwd: setting unix command through perl script

Oops -- did reply and instead of reply-all :-(

---------- Forwarded message ----------
From: Kenneth Wolcott <kennethwolcott@xxxxxxxxx>
Date: Wed, Apr 16, 2008 at 11:33 AM
Subject: Re: setting unix command through perl script
To: martin@xxxxxxxxxx


Agreed that the parent process in which perl was invoked will not be
changed
by the perl script.

What is the overall objective?

Try to do everything you need to do inside the perl script, or
everything
you need to do outside the perl script.

HTH,
Ken Wolcott


On Wed, Apr 16, 2008 at 5:31 AM, Martin Barth <martin@xxxxxxxxxx> wrote:

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/


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



.



Relevant Pages

  • RE: setting unix command through perl script
    ... setting unix command through perl script ... it changes the environment of the shell you ... If I run this command on bash prompt then it is executing properly but ...
    (perl.beginners)
  • RE: setting unix command through perl script
    ... I have run the command like this.... ... setting unix command through perl script ... shell you spawn with qx; but after this statement your shell ... To unsubscribe, e-mail: beginners-unsubscribe@xxxxxxxx ...
    (perl.beginners)
  • RE: setting unix command through perl script
    ... setting unix command through perl script ... Agreed that the parent process in which perl was invoked will not ... To unsubscribe, e-mail: beginners-unsubscribe@xxxxxxxx ...
    (perl.beginners)
  • Re: Update message on web page while processing
    ... One of the simplest solutions for this is to have the web application ... The command line application, in this situation, could write a simple ... some years ago for live reports that took 10 minutes or so to complete. ... The web application fired off a PERL script that did the processing, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: CGI script: release browser after spawning new process
    ... > filled form and pass them along as command line parameters to another ... > perl script that should run the computation in the background. ... You have to close STDOUT and STDERR, ... You need a fork to protect from this. ...
    (comp.lang.perl.misc)