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).
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?).
So, a working code could be:
use Apache::URI;
require APR::URI if MP2;
my $uri = MP2 ? APR::URI->parse($r->pool,$r->construct_url) : Apache::URI->parse($r);
I'm missing some things, or there's a better way?
Thanks in advance
by
- Enrico
--
Reporting bugs: http://perl.apache.org/bugs/
Mail list info: http://perl.apache.org/maillist/modperl.html