On 2010.05.27 20:15, Marilyn Sander wrote:
> 
> On May 27, 2010, at 4:58 PM, Jim Gibson wrote:
> 
>> On 5/27/10 Thu  May 27, 2010  4:51 PM, "Bob Sadri" <bob.m.sa...@gmail.com>
>> scribbled:
>>
>>> Hi
>>> I have a perl script that calls a csh script.  The csh script sources some
>>> environment variables (among others).  When the control comes back to my
>>> perl script I like to use the environment variables set in the csh script.
>>> However, since this has happened in the child shell environment I am not
>>> able to see the variables.
>>> Can someone help me with this problem?
>>
>> Consult the advice given by 'perldoc -q environment'. Short answer: "can't
>> be done".
>>

> If you know what file it sources, you could read that file and get the 
> variables.

My guess, considering that the Perl script is calling the csh script
that it not only can execute it, but also read it. If you pre-read the
csh script prior to execution, you may be able to grab the vars from there.

In some cases, the csh script may `include' other scripts that may set
up the env themselves. In this case, since you do have read access to
the parent csh file, you can grok those filenames, read into them, and
find out what env vars you need to set prior to executing anything.

fwiw, I have had to do this in the recent past.

Steve

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


Reply via email to