Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: ModPerl: ModPerl

Perlhandler bugs when set up on the root of the domain

 

 

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded


davidlevy.n7 at gmail

Jun 12, 2012, 6:01 AM

Post #1 of 2 (289 views)
Permalink
Perlhandler bugs when set up on the root of the domain

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?

Thanks
David


torsten.foertsch at gmx

Jun 12, 2012, 6:41 AM

Post #2 of 2 (268 views)
Permalink
Re: Perlhandler bugs when set up on the root of the domain [In reply to]

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

ModPerl modperl RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.