Enrico Sorcinelli wrote:
Hi all,
I'm porting to mp2 this mp1 code:

use Apache::URI;
my $uri = Apache::URI->parse($r);
# now I can work with $uri->hostinfo, $uri->scheme, etc

In mp2, 'parse' method has moved from Apache::URI to APR::URI.
Moreover the method syntax is changed:

APR::URI->parse($r->pool,$uri);

Because I need 'hostinfo' and 'scheme' methods, I must pass a complete url
to APR::UR->parse (in mp1 this wasn't necessary).

Since APR::URI is a generic method, not HTTP specific, you need to pass a complete URI to it.


There is parse_uri in Apache::URI that's HTTP specific, which is probably the method you are after. See t/response/TestAPI/uri.pm in the mp2 source.

So I've used APR::URI->parse($r->pool,$r->construct_url) ad docs
explains. However I also must require Apache::URI (maybe the doc can be
updated?).

You need to load Apache::URI for $r->construct_url, not for APR::URI->parse. So the docs need not to be updated for this issue, though I'm sure others issues could be documented and improved. e.g. APR::URI::parse vs. Apache::URI::parse_uri.


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:[EMAIL PROTECTED] http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


-- Reporting bugs: http://perl.apache.org/bugs/ Mail list info: http://perl.apache.org/maillist/modperl.html



Reply via email to