in reply to Re^3: calling external programs via cgi perl script
in thread calling external programs via cgi perl script

for some reason, source foo; doesn't work for me. this is my foo file:
#!/bin/tcsh set circuit_os = Linux.7.3 setenv CIRCUIT_LIC /tools/circuit/difflib/asdf.lic setenv SERVER_LIC /tools/circuit/difflib/server.lic
and when I execute this:
my @lines =`. foo; env`; foreach my $line (@lines) { print "[DEBUG] $line <br>\n"; }
I don't understand why I'm also getting this:
sh: line 6: setenv: command not found sh: line 7: setenv: command not found
I don't see any of those variables in output.

Replies are listed 'Best First'.
Re^5: calling external programs via cgi perl script
by Fletch (Bishop) on Mar 23, 2007 at 14:57 UTC

    It doesn't work because you're trying to use csh commands in a Bourne shell. Explicitly run things with csh, or rewrite the environment variable setting script using sh syntax (as cdarke mentioned already above).