[prev in list] [next in list] [prev in thread] [next in thread] 

List:       apache-modperl
Subject:    Re: Apache2::Request
From:       John Drago <jdrago_999 () yahoo ! com>
Date:       2008-05-23 17:30:53
Message-ID: 55176.5162.qm () web54304 ! mail ! re2 ! yahoo ! com
[Download RAW message or body]


--- adam.prime@utoronto.ca wrote:

> Quoting xyon <xyon@indigorobot.com>:
> 
> > Shouldn't it be:
> >
> >  sub my_handler {
> >    my $r = shift;
> >    my $req = Apache2::Request->new($r, POST_MAX =>
> "1M");
> > ...
> >
> 
> Provided that you've actually installed libapreq  
> (http://httpd.apache.org/apreq/), that should work.
> 
> 


Your mod_perl handler is passed either 1 or 2
parameters, depending on how you declare your method.

Example:

sub handler {
  my ($r) = @_;
}


sub handler : method {
  my ($class, $r) = @_;
}

In either case, $r is an Apache2::RequestRec.  The
difference is the ": method" attribute that tells
mod_perl to pass your "handler" sub 2 parameters
instead of just 1.

- John Drago
http://www.devstack.com
http://search.cpan.org/dist/Apache2-ASP












      
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic