On Tue, Nov 27, 2001 at 06:02:12PM -0200, Mcgregory Pinto wrote: > my $grg = $ENV{GRG}; > print "$grg\n"; // must print 'aaa' > system("xxx.sh") > my $grg = $ENV{GRG}; > print "$grg\n"; // must print 'xxx' > system("zzz.sh") > my $grg = $ENV{GRG}; > print "$grg\n"; // must print 'zzz' > > How can i do this ???
You can't. A child process cannot affect a parent's environment variables. You'll have to do something else, such as assign `zzz.sh` (that is, invoke zzz.sh and assign the output) to $ENV{GRG}, or use some other interprocess communication mechanism. By the way, why are you using an environmental variable for this? Is it because you thought they could be transferred between processes, or for some other reason? Michael -- Administrator www.shoebox.net Programmer, System Administrator www.gallanttech.com -- -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]