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. :-)

In reply to mod_perl2 packages missing. by TedYoung

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.