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". >
Well, if you are allowed to modify the csh script, you can make it print the variables to a file or stdout, and capture that output. If you know what file it sources, you could read that file and get the variables. I would say that if your Perl script needs to know what environment the csh script is using, and it is part of a larger application that includes the csh script, then the environment-setting should be made a public interface that is accessible to your Perl script. But if you are just trying to snoop on what the csh script is doing, you are out of luck. --Marilyn -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/