CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Intermediate:
sourcing csh file from perl script



Jun 1, 2011, 4:14 AM

Post #1 of 2 (615 views)
sourcing csh file from perl script Can't Post

I am trying to source a start.csh file which contains environment variables settings and sourcing of other files too. When I try to source them using backtickes or system or exec, then the code in he later part of the script do npt have visibility of the variables in start.csh. How do I achieve it? Please help

print $im;


Jun 1, 2011, 1:10 PM

Post #2 of 2 (610 views)
Re: [nibalan] sourcing csh file from perl script [In reply to] Can't Post

You're trying to have a child process modify the environment of its parent, this doesn't work.

The same thing occurs the other way, when you try to have a perl script change the environment of the shell that you're running it under.

perldoc - I changed my environment in a perl script...

As for a solution, you could manually read the .sh script and set the $ENV vars yourself.

- Miller


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives