perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From André Warnier>
Subject Re: Usage: APR::URI::parse(classname, p_sv, uri)
Date Mon, 19 Nov 2012 22:22:55 GMT
Samuel Gómez wrote:
> Hi,
> In a mod_perl handler I am writing I wrote
> my $parsed_uri = APR::URI->parse($r->pool, $uri);
> as stated by
> but on execution it gave me this error:
> "Usage: APR::URI::parse(classname, p_sv, uri)"
> So I have three questions.
> 1. I think there is an error regarding the APR::URI->parse method either in
> the mod_perl documentation, or in mod_perl itself.
> 2. If mod_perl is right, what is a classname? Please provide an example.
> 3. Actually I was using that line to get the hostname of the request. I
> replaced it by
> my $uri_hostname = $r->hostname;
> and it is apparently working. I'm I doing it right?

I don't know about the first problem you mention.
But the APR::URI module is for manipulating URI's in general.  Any URI.

If all you want is the target hostname of the current request, then your second method (in

(3)) is easier, probably much faster, and does not force you to load the APR::URI module.

View raw message