X
xdarcos
Hello,
I am using perl scripts as CGI. What I want to do is to call another
perl script where I only set environment variables (envCGI.pl).
If I set these variables in my initial perl script, it works well (I
get my HTML page) but if I call the other perl script, I get:
[12/Jan/2005:10:43:22] failure ( 632): for host 10.70.176.104 trying
to POST /surcouf.cgi, cgi_scan_headers reports: HTTP4044: the CGI
program C:\Perl\bin\perl.exe did not produce a valid header (program
terminated without a valid CGI header. Check for core dump or other
abnormal termination).
Here is my perl script:
#!C:/perl/bin/perl.exe
exec('envCGI.pl');
//Then an exe is executed (in which the content-type is set) and the
HTML page is well displayed.
$matchAdmin = "Routage%3DADMIN";
$matchConso = "Routage%3DCONSO";
if ($ENV{QUERY_STRING} =~ /$matchAdmin/)
{
$cmd = 'admin.exe'; exec($cmd);
}
elsif ($ENV{QUERY_STRING} =~ /$matchConso/)
{
$cmd = 'conso.exe'; exec($cmd);
}
else
{
$cmd = 'contrat.exe'; exec($cmd);
}
I tried also to use: system('envCGI.pl'). There are no errors but the
variables are not set. Is there an equivalent of EXPORT command of Unix
?
Thanks for your help
Xavier
Note:I am using SunOne Web Server 6.1 and I am under Windows 2000
I am using perl scripts as CGI. What I want to do is to call another
perl script where I only set environment variables (envCGI.pl).
If I set these variables in my initial perl script, it works well (I
get my HTML page) but if I call the other perl script, I get:
[12/Jan/2005:10:43:22] failure ( 632): for host 10.70.176.104 trying
to POST /surcouf.cgi, cgi_scan_headers reports: HTTP4044: the CGI
program C:\Perl\bin\perl.exe did not produce a valid header (program
terminated without a valid CGI header. Check for core dump or other
abnormal termination).
Here is my perl script:
#!C:/perl/bin/perl.exe
exec('envCGI.pl');
//Then an exe is executed (in which the content-type is set) and the
HTML page is well displayed.
$matchAdmin = "Routage%3DADMIN";
$matchConso = "Routage%3DCONSO";
if ($ENV{QUERY_STRING} =~ /$matchAdmin/)
{
$cmd = 'admin.exe'; exec($cmd);
}
elsif ($ENV{QUERY_STRING} =~ /$matchConso/)
{
$cmd = 'conso.exe'; exec($cmd);
}
else
{
$cmd = 'contrat.exe'; exec($cmd);
}
I tried also to use: system('envCGI.pl'). There are no errors but the
variables are not set. Is there an equivalent of EXPORT command of Unix
?
Thanks for your help
Xavier
Note:I am using SunOne Web Server 6.1 and I am under Windows 2000