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

Greetings, I am trying to source a cshrc file in perl. As far as I can tell, I can only use "sh" commands. I could use the "." command to source a file, but then I would get a syntax error because of the cshrc shell syntax. Any ideas? Cheers, Kirby

Replies are listed 'Best First'.
Re: csh commands in Perl
by tadman (Prior) on Mar 24, 2001 at 04:01 UTC
    If you want 'csh', you have to ask for it.
    sub shellcmd { my ($shell) = shift; open (SHELL, "$shell |") || return $?; return join ('', <SHELL>); } # Such as: $find = shellcmd ("/bin/csh", "find / -name 'xyz*'");
    (Reposted from an earlier post)
Re: csh commands in Perl
by Dominus (Parson) on Mar 25, 2001 at 19:48 UTC
Re: csh commands in Perl
by busunsl (Vicar) on Mar 24, 2001 at 02:58 UTC
    Try to set your environment variable SHELL to /bin/csh, that should work.