Re: Perlhandler bugs when set up on the root of the domain

Torsten Förtsch <[email protected]>
Newsgroups gmane.comp.apache.mod-perl
Message-ID <[email protected]>
On 06/12/2012 03:01 PM, David Levy wrote:
> Hi everyone,
> 
> i've start working with mod_perl and perlhandler few weeks ago in a
> folder of my domain (mydomain.com/folder/) and everything was fine.
> 
> I've recently tried to set it up on the root of my domain, but now, i've
> got an error 500 when i try to go to mydomain.com and the logs says :
> 
>  Can't locate object method "content_type" via package
> "Apache2::RequestRec" at /usr/lib/perl5/...
> 
> And if i add use Apache2::RequestRec after my package definition the
> error change from content_type to print.
> The test code is really simple :
> package test2::Rules2;
> use Apache2::Const qw(:common);
> 
> sub handler {
> my $r = shift;
> $r->content_type("text/plain");
> $r->print("mod_perl rules!\n");
> return OK;
> }
> 1;
> 
> Any idea on where it comes from?

Don't know why it *had* worked, but

  use Apache2::RequestRec ();     # pulls in content_type()
  use Apache2::RequestIO ();      # pulls in print()

is missing here.

One of the first things I did several years ago when I started with
modperl2 was to define this bash alias:

  alias mp2lookup='perl -MModPerl::MethodLookup -e print_method'

Now, if I don't know which module defines which method I can ask:

$ mp2lookup print
There is more than one class with method 'print'
try one of:
        use Apache2::Filter ();
        use Apache2::RequestIO ();

Torsten
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.