pawa has asked for the wisdom of the Perl Monks concerning the following question:

Hi i am trying to run a tcsh script from within perl and having some problem. perl code looks like below

 `tcsh -c runscript`

where runscript contains

 source setup; ....

setup file contains

 setenv DD "kk"

when i run the perl script it gives the error setenv not found. could anybody point to what is going on

Replies are listed 'Best First'.
Re: Problems while trying to run tcsh script from perl
by Laurent_R (Canon) on May 29, 2013 at 20:46 UTC

    Looks like a *nix problem rather than a Perl problem. By the way, setenv gives me an error (unknown command) on my *nix box when I run it from the shell prompt. Did you try it from the shell prompt? The command may have a different name on your specific shell. And if it works on your box, try "which setenv" to find the path if it is an external command, and give the full path if you get one. I am no expert on that, just my 2-cents worth...