Apache::URI - URI component parsing and unparsing |
Apache::URI - URI component parsing and unparsing
use Apache::URI (); my $uri = $r->parsed_uri;
my $uri = Apache::URI->parse($r, "http://perl.apache.org/");
This module provides an interface to the Apache util_uri module and the uri_components structure.
my $uri = $r->parsed_uri;
my $uri = Apache::URI->parse($r, "http://www.foo.com/path/file.html?query+string");
This method is considerably faster than using URI::URL:
timethese(5000, { C => sub { Apache::URI->parse($r, $test_uri) }, Perl => sub { URI::URL->new($test_uri) }, });
Benchmark: timing 5000 iterations of C, Perl... C: 1 secs ( 0.62 usr 0.04 sys = 0.66 cpu) Perl: 6 secs ( 6.21 usr 0.08 sys = 6.29 cpu)
my $string = $uri->unparse;
my $scheme = $uri->scheme;
my $hostinfo = $uri->hostinfo;
my $user = $uri->user;
my $password = $uri->password;
my $hostname = $uri->hostname;
my $port = $uri->port;
my $path = $uri->path;
my $path = $uri->rpath;
my $query = $uri->query;
my $fragment = $uri->fragment;
Doug MacEachern
perl(1).
Apache::URI - URI component parsing and unparsing |