Empty $r in mod_perl
am 06.01.2007 11:42:45 von jason.yfhoDear All,
I installed mod_perl 2 (static mod) in my linux, however, seems the
perl script cannot invoke the mod_perl's function. anyone can give me
some ideaa on the problem? My purpose of using mod_perl is the get the
full header of all HTTP request to Apache. Thank you so much! Below is
the scenario:
System:
- Fedora 3
- Apache 2.2.3
- Perl 5.8.8
I added the following in httpd.conf:
PerlModule Apache2::Registry
.......
Options Indexes FollowSymLinks ExecCGI
PerlHandler Apache2::Registry
PerlSendHeader On
.......
When apache starts, the error_log shows:
[Sat Jan 06 18:43:54 2007] [notice] Apache/2.2.3 (Unix) mod_perl/2.0.3
Perl/v5.8.8 configured -- resuming normal operations
My perl script in "/usr/local/apache2/htdocs/test1.pl":
#!/usr/local/bin/perl5.8.8
use strict;
my $r = shift;
$r->print("It worked!!!\n");
The following error in error_log:
[Sat Jan 06 18:44:32 2007] [error] [client 192.168.1.35] Can't call
method "print" on an undefined value at
/usr/local/apache2/htdocs/test1.pl line 8.
Regards,
Jason