Trying to narrow down a problem I am having with mod_perl::PerlRun on a
stock RedHat 8.0 system, I have the following that simply doesn't work
reliably under Apache 2.0.40 and mod_perl-1.99_05-3. The script runs fine
for the first few refreshes and then I get the ominous error message:
Error message:
Not a CODE reference at /home/usa/cgi-bin/env.cgi line 7.
After a few retries and then nothing seems to fix it until I do a cold
restart on Apache.
env.cgi is:
#!/usr/bin/perl
print "Content-type: text/html\n\n";
require "/home/usa/cgi-bin/authlib_test.pl" ;
my $status = testsub() ;
foreach (keys %ENV){
print "$_ -> $ENV{$_}<br>\n";
}
and the file authlib_test.pl contains:
sub testsub {
return 1 ;
}
1;
If I move the code for authlib_test.pl into env.cgi, it works all the time,
moving it into that seperate file that is required seems to break it. I am
trying to reproduce a code snippet that causes my production mod_perl
programs to produce a zero byte response page (no data returned, but returns
with a status 200). But this is far as I get.
The config is:
LoadModule perl_module modules/mod_perl.so
PerlModule Apache2
Alias /perl /home/usa/cgi-bin
<Directory /home/usa/cgi-bin>
SetHandler perl-script
PerlHandler ModPerl::PerlRun
PerlOptions +ParseHeaders
PerlSendHeader On
Options ExecCGI FollowSymLinks Includes
</Directory>
I also tried this on the CVS code for apache and mod_perl and get the same
results, so I dropped back to the standard RPM versions with RedHat.
Any ideas?
thanks
dale