Hello,
I am trying to get mod_perl2 running a debian 3 box. Naturally I have Apach2 and Mod_Perl2 packages installed. The problem is my test handler cannot find any of the Apache2 or ModPerl libs in @INC.
My Handler:
package CEAS4;
use strict;
use warnings;
use Apache2::Const -compile => qw(OK);
sub handler {
my $r = shift;
print "Content-type: text/html\n\n";
print "mod_perl 2.0 rocks!\n";
return Apache2::Const::OK;
}
1;
My error message:
failed to resolve handler `CEAS4': Can't locate Apache2/Const.pm in @I
+NC (@INC contains: /home/www/hosts/dev/ceas4 /etc/perl /usr/local/lib
+/perl/5.8.4 /usr/local/share/perl/5.8.4 /usr/lib/perl5 /usr/share/per
+l5 /usr/lib/perl/5.8 /usr/share/perl/5.8 /usr/local/lib/site_perl . /
+etc/apache2) at /home/www/hosts/dev/ceas4/CEAS4.pm line 11.\nBEGIN fa
+iled--compilation aborted at /home/www/hosts/dev/ceas4/CEAS4.pm line
+11.\nCompilation failed in require at (eval 2) line 3.
Where things get really silly is my list of files in /usr/lib/perl5:
/usr/lib/perl5/Apache2
/usr/lib/perl5/Apache2/Apache
/usr/lib/perl5/Apache2/Apache/Access.pm
/usr/lib/perl5/Apache2/Apache/BuildConfig.pm
/usr/lib/perl5/Apache2/Apache/Build.pm
/usr/lib/perl5/Apache2/Apache/CmdParms.pm
/usr/lib/perl5/Apache2/Apache/Command.pm
/usr/lib/perl5/Apache2/Apache/compat.pm
/usr/lib/perl5/Apache2/Apache/Connection.pm
/usr/lib/perl5/Apache2/Apache/Const.pm
/usr/lib/perl5/Apache2/Apache/Directive.pm
/usr/lib/perl5/Apache2/Apache/Filter.pm
/usr/lib/perl5/Apache2/Apache/FilterRec.pm
/usr/lib/perl5/Apache2/Apache/HookRun.pm
/usr/lib/perl5/Apache2/Apache/Log.pm
/usr/lib/perl5/Apache2/Apache/Module.pm
...
/usr/lib/perl5/Apache2/APR/Const.pm
/usr/lib/perl5/Apache2/APR/Date.pm
/usr/lib/perl5/Apache2/APR/Error.pm
/usr/lib/perl5/Apache2/APR/Finfo.pm
/usr/lib/perl5/Apache2/APR/IpSubnet.pm
...
/usr/lib/perl5/Apache2/ModPerl/RegistryCooker.pm
/usr/lib/perl5/Apache2/ModPerl/RegistryLoader.pm
/usr/lib/perl5/Apache2/ModPerl/Registry.pm
/usr/lib/perl5/Apache2/ModPerl/StructureMap.pm
/usr/lib/perl5/Apache2/ModPerl/TestReport.pm
...
Using Apache2::Apache:: instead of just Apache2:: doesn't work because it cannot find ModPerl::
So, I thought that /usr/lib/perl5/Apache2 should have been in @INC, but then the namespace for everything would just be Apache:: not Apache2::
What am I doing wrong here?
Ted Young
($$<<$$=>$$<=>$$<=$$>>$$) always returns 1. :-)