I'm working with apache 1.3.22 on Sun0S5.8 and believe apache is
killing my perl CGI script whenever it redirects or closes STDOUT. I
need to close STDOUT in a child process that I'm intending to create.
I've created some sample code that captures this problem. When apache
runs the following code as a CGI script, my web browser displays
"Hellooooo how are you?" but the die error message never makes it to
the log file. If I run this script from the command line I get the
both the greeting and the die error message. If I comment out
the line 'close STDOUT' and launch it from a web browser the die error
message is displayed in the log file.
#!/usr/bin/perl
select((STDOUT, $|=1)[0]); #flush STDOUT writes immediately!
print "Content-type: text/html\r\n\r\n";
print "Hellooooo how are you?\n";
if ($pid != fork) {
close STDOUT;
die "ERROR: $!";
Thanks for your help in advance,Quote:}
John