perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Foertsch <torsten.foert...@gmx.net>
Subject Re: location
Date Thu, 03 May 2007 14:54:00 GMT
On Thursday 03 May 2007 16:34, Jonathan Vanasco wrote:
> On May 3, 2007, at 2:54 AM, Torsten Foertsch wrote:
> > http://perl.apache.org/docs/2.0/api/Apache2/
> > RequestUtil.html#C_location_
>
> Thats even odder...
>
> $r is a RequestRec, not RequestUtil
>
> And according to those docs, RequestUtil ISA RequestRec , not the
> other way around.
>
> location really shouldn't be working out of RequestRec then.

This is an excerpt from the generated 
WrapXS/Apache2/RequestUtil/RequestUtil.xs

MODULE = Apache2::RequestUtil    PACKAGE = Apache2::RequestRec   PREFIX = 
mpxs_Apache2__RequestRec_

char *
mpxs_Apache2__RequestRec_location(r)
    Apache2::RequestRec r

You see the location function is created directly in the Apache2::RequestRec 
namespace (the PACKAGE = ...).

The perl equivalent would be a file named Apache2/RequestUtil.pm that starts 
with a "package Apache2::RequestRec" line. When you now load 
Apache2::RequestUtil all functions in the file will be added to the 
Apache2::RequestRec namespace.

This is a common pattern in mod_perl.

Torsten

Mime
View raw message