← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/bin/epoll_server.pl
  Run on Wed Jan 5 05:34:33 2011
Reported on Wed Jan 5 05:41:10 2011

File /usr/lib/perl5/vendor_perl/5.10.1/URI.pm
Statements Executed 3142
Statement Execution Time 43.7ms
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
261624826.3ms26.3msURI::::__ANON__[:24]URI::__ANON__[:24]
1111.89ms2.21msURI::::BEGIN@22URI::BEGIN@22
12221.37ms2.31msURI::::canonicalURI::canonical
11111.10ms4.35msURI::::newURI::new
1111881µs2.54msURI::::_initURI::_init
1111828µs1.49msURI::::_uric_escapeURI::_uric_escape
6462385µs385µsURI::::CORE:substURI::CORE:subst (opcode)
1111373µs373µsURI::::implementorURI::implementor
1211323µs406µsURI::::_schemeURI::_scheme
5822309µs309µsURI::::CORE:substcontURI::CORE:substcont (opcode)
6552247µs247µsURI::::CORE:regcompURI::CORE:regcomp (opcode)
7862225µs225µsURI::::CORE:matchURI::CORE:match (opcode)
911114µs114µsURI::::cloneURI::clone
111106µs106µsURI::::BEGIN@21URI::BEGIN@21
11127µs102µsURI::::BEGIN@24URI::BEGIN@24
11126µs32µsURI::::BEGIN@3URI::BEGIN@3
11123µs54µsURI::::BEGIN@127URI::BEGIN@127
11114µs188µsURI::::BEGIN@13URI::BEGIN@13
11114µs132µsURI::::BEGIN@7URI::BEGIN@7
11113µs62µsURI::::BEGIN@4URI::BEGIN@4
0000s0sURI::::STORABLE_freezeURI::STORABLE_freeze
0000s0sURI::::STORABLE_thawURI::STORABLE_thaw
0000s0sURI::::__ANON__[:25]URI::__ANON__[:25]
0000s0sURI::::__ANON__[:26]URI::__ANON__[:26]
0000s0sURI::::_init_implementorURI::_init_implementor
0000s0sURI::::_no_scheme_okURI::_no_scheme_ok
0000s0sURI::::_obj_eqURI::_obj_eq
0000s0sURI::::absURI::abs
0000s0sURI::::as_iriURI::as_iri
0000s0sURI::::as_stringURI::as_string
0000s0sURI::::eqURI::eq
0000s0sURI::::fragmentURI::fragment
0000s0sURI::::new_absURI::new_abs
0000s0sURI::::opaqueURI::opaque
0000s0sURI::::relURI::rel
0000s0sURI::::schemeURI::scheme
0000s0sURI::::secureURI::secure
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package URI;
2
3342µs238µs
# spent 32µs (26+6) within URI::BEGIN@3 which was called # once (26µs+6µs) by HTTP::Body::BEGIN@24 at line 3
use strict;
# spent 32µs making 1 call to URI::BEGIN@3 # spent 6µs making 1 call to strict::import
4352µs2110µs
# spent 62µs (13+48) within URI::BEGIN@4 which was called # once (13µs+48µs) by HTTP::Body::BEGIN@24 at line 4
use vars qw($VERSION);
# spent 62µs making 1 call to URI::BEGIN@4 # spent 48µs making 1 call to vars::import
512µs$VERSION = "1.54";
6
7354µs2249µs
# spent 132µs (14+117) within URI::BEGIN@7 which was called # once (14µs+117µs) by HTTP::Body::BEGIN@24 at line 7
use vars qw($ABS_REMOTE_LEADING_DOTS $ABS_ALLOW_RELATIVE_SCHEME $DEFAULT_QUERY_FORM_DELIMITER);
# spent 132µs making 1 call to URI::BEGIN@7 # spent 117µs making 1 call to vars::import
8
91900nsmy %implements; # mapping from scheme to implementor class
10
11# Some "official" character classes
12
1331.06ms2362µs
# spent 188µs (14+174) within URI::BEGIN@13 which was called # once (14µs+174µs) by HTTP::Body::BEGIN@24 at line 13
use vars qw($reserved $mark $unreserved $uric $scheme_re);
# spent 188µs making 1 call to URI::BEGIN@13 # spent 174µs making 1 call to vars::import
141800ns$reserved = q(;/?:@&=+$,[]);
1511µs$mark = q(-_.!~*'()); #'; emacs
1613µs$unreserved = "A-Za-z0-9\Q$mark\E";
1712µs$uric = quotemeta($reserved) . $unreserved . "%";
18
191800ns$scheme_re = '[a-zA-Z][a-zA-Z0-9.+\-]*';
20
21345µs1106µs
# spent 106µs within URI::BEGIN@21 which was called # once (106µs+0s) by HTTP::Body::BEGIN@24 at line 21
use Carp ();
# spent 106µs making 1 call to URI::BEGIN@21
223384µs12.21ms
# spent 2.21ms (1.89+319µs) within URI::BEGIN@22 which was called # once (1.89ms+319µs) by HTTP::Body::BEGIN@24 at line 22
use URI::Escape ();
# spent 2.21ms making 1 call to URI::BEGIN@22
23
24261633.3ms
# spent 26.3ms within URI::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/URI.pm:24] which was called 2616 times, avg 10µs/call: # 861 times (11.6ms+0s) by Catalyst::CORE:subst at line 1330 of Catalyst.pm, avg 13µs/call # 861 times (6.94ms+0s) by Catalyst::uri_for at line 1352 of Catalyst.pm, avg 8µs/call # 836 times (7.34ms+0s) by Template::Document::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/Epoll/root/templates/admin/voters.tt:105] at line 69 of Epoll/root/templates/admin/voters.tt, avg 9µs/call # 22 times (191µs+0s) by Catalyst::DispatchType::Path::register_path at line 124 of Catalyst/DispatchType/Path.pm, avg 9µs/call # 11 times (86µs+0s) by Catalyst::DispatchType::Path::CORE:subst at line 121 of Catalyst/DispatchType/Path.pm, avg 8µs/call # 4 times (31µs+0s) by Template::Document::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/Epoll/root/templates/includes/header.tt:65] at line 10 of Epoll/root/templates/includes/header.tt, avg 8µs/call # 3 times (13µs+0s) by Template::Document::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/Epoll/root/mail/voting_passwd.tt:39] at line 7 of Epoll/root/mail/voting_passwd.tt, avg 4µs/call # 2 times (13µs+0s) by Template::Document::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/Epoll/root/templates/includes/header.tt:65] at line 16 of Epoll/root/templates/includes/header.tt, avg 7µs/call # once (10µs+0s) by Template::Document::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/Epoll/root/templates/includes/header.tt:65] at line 8 of Epoll/root/templates/includes/header.tt # once (8µs+0s) by Template::Document::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/Epoll/root/templates/admin/voters.tt:105] at line 33 of Epoll/root/templates/admin/voters.tt # once (8µs+0s) by Template::Document::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/Epoll/root/templates/includes/admin_menu.tt:31] at line 11 of Epoll/root/templates/includes/admin_menu.tt # once (8µs+0s) by Template::Document::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/Epoll/root/templates/includes/header.tt:65] at line 30 of Epoll/root/templates/includes/header.tt # once (7µs+0s) by Template::Document::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/Epoll/root/templates/includes/header.tt:65] at line 14 of Epoll/root/templates/includes/header.tt # once (7µs+0s) by Template::Document::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/Epoll/root/templates/admin/voters.tt:105] at line 24 of Epoll/root/templates/admin/voters.tt # once (7µs+0s) by Template::Document::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/Epoll/root/templates/includes/admin_menu.tt:31] at line 5 of Epoll/root/templates/includes/admin_menu.tt # once (7µs+0s) by Template::Document::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/Epoll/root/templates/includes/admin_menu.tt:31] at line 19 of Epoll/root/templates/includes/admin_menu.tt # once (7µs+0s) by Template::Document::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/Epoll/root/templates/includes/header.tt:65] at line 7 of Epoll/root/templates/includes/header.tt # once (7µs+0s) by Template::Document::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/Epoll/root/templates/includes/admin_menu.tt:31] at line 7 of Epoll/root/templates/includes/admin_menu.tt # once (7µs+0s) by Template::Document::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/Epoll/root/templates/includes/locale_select_form.tt:13] at line 2 of Epoll/root/templates/includes/locale_select_form.tt # once (7µs+0s) by Template::Document::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/Epoll/root/templates/includes/admin_menu.tt:31] at line 9 of Epoll/root/templates/includes/admin_menu.tt # once (7µs+0s) by Template::Document::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/Epoll/root/templates/admin/voters.tt:105] at line 9 of Epoll/root/templates/admin/voters.tt # once (6µs+0s) by Template::Document::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/Epoll/root/templates/includes/footer.tt:15] at line 6 of Epoll/root/templates/includes/footer.tt # once (4µs+0s) by Template::Document::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/Epoll/root/templates/includes/header.tt:65] at line 28 of Epoll/root/templates/includes/header.tt # once (4µs+0s) by Template::Document::__ANON__[/usr/lib/perl5/vendor_perl/5.10.1/Epoll/root/templates/includes/header.tt:65] at line 27 of Epoll/root/templates/includes/header.tt # spent 102µs (27+75) within URI::BEGIN@24 which was called # once (27µs+75µs) by HTTP::Body::BEGIN@24 at line 28
use overload ('""' => sub { ${$_[0]} },
25 '==' => sub { _obj_eq(@_) },
26 '!=' => sub { !_obj_eq(@_) },
27120µs175µs fallback => 1,
# spent 75µs making 1 call to overload::import
282989µs1102µs );
# spent 102µs making 1 call to URI::BEGIN@24
29
30# Check if two objects are the same object
31sub _obj_eq {
32 return overload::StrVal($_[0]) eq overload::StrVal($_[1]);
33}
34
35sub new
36
# spent 4.35ms (1.10+3.25) within URI::new which was called 11 times, avg 396µs/call: # 11 times (1.10ms+3.25ms) by Catalyst::DispatchType::Path::register_path at line 120 of Catalyst/DispatchType/Path.pm, avg 396µs/call
{
371135µs my($class, $uri, $scheme) = @_;
38
391129µs $uri = defined ($uri) ? "$uri" : ""; # stringify
40 # Get rid of potential wrapping
4111233µs11158µs $uri =~ s/^<(?:URL:)?(.*)>$/$1/; #
# spent 158µs making 11 calls to URI::CORE:subst, avg 14µs/call
421172µs1118µs $uri =~ s/^"(.*)"$/$1/;
# spent 18µs making 11 calls to URI::CORE:subst, avg 2µs/call
4311102µs1146µs $uri =~ s/^\s+//;
# spent 46µs making 11 calls to URI::CORE:subst, avg 4µs/call
441182µs1130µs $uri =~ s/\s+$//;
# spent 30µs making 11 calls to URI::CORE:subst, avg 3µs/call
45
461114µs my $impclass;
4711229µs2290µs if ($uri =~ m/^($scheme_re):/so) {
# spent 65µs making 11 calls to URI::CORE:regcomp, avg 6µs/call # spent 25µs making 11 calls to URI::CORE:match, avg 2µs/call
48 $scheme = $1;
49 }
50 else {
511134µs if (($impclass = ref($scheme))) {
52 $scheme = $scheme->scheme;
53 }
54 elsif ($scheme && $scheme =~ m/^($scheme_re)(?::|$)/o) {
55 $scheme = $1;
56 }
57 }
58 $impclass ||= implementor($scheme) ||
5911152µs11373µs do {
# spent 373µs making 11 calls to URI::implementor, avg 34µs/call
60 require URI::_foreign;
61 $impclass = 'URI::_foreign';
62 };
63
6411316µs112.54ms return $impclass->_init($uri, $scheme);
# spent 2.54ms making 11 calls to URI::_init, avg 231µs/call
65}
66
67
68sub new_abs
69{
70 my($class, $uri, $base) = @_;
71 $uri = $class->new($uri, $base);
72 $uri->abs($base);
73}
74
75
76sub _init
77
# spent 2.54ms (881µs+1.65) within URI::_init which was called 11 times, avg 231µs/call: # 11 times (881µs+1.65ms) by URI::new at line 64, avg 231µs/call
{
781125µs my $class = shift;
791132µs my($str, $scheme) = @_;
80 # find all funny characters and encode the bytes.
811179µs111.49ms $str = $class->_uric_escape($str);
# spent 1.49ms making 11 calls to URI::_uric_escape, avg 135µs/call
8211330µs33167µs $str = "$scheme:$str" unless $str =~ /^$scheme_re:/o ||
# spent 72µs making 11 calls to URI::CORE:regcomp, avg 7µs/call # spent 69µs making 11 calls to URI::_generic::_no_scheme_ok, avg 6µs/call # spent 26µs making 11 calls to URI::CORE:match, avg 2µs/call
83 $class->_no_scheme_ok;
8411261µs my $self = bless \$str, $class;
851190µs $self;
86}
87
88
89sub _uric_escape
90
# spent 1.49ms (828µs+660µs) within URI::_uric_escape which was called 11 times, avg 135µs/call: # 11 times (828µs+660µs) by URI::_init at line 81, avg 135µs/call
{
911126µs my($class, $str) = @_;
9231892µs71660µs $str =~ s*([^$uric\#])* URI::Escape::escape_char($1) *ego;
# spent 440µs making 20 calls to URI::Escape::escape_char, avg 22µs/call # spent 127µs making 29 calls to URI::CORE:substcont, avg 4µs/call # spent 67µs making 11 calls to URI::CORE:subst, avg 6µs/call # spent 26µs making 11 calls to URI::CORE:regcomp, avg 2µs/call
9311147µs return $str;
94}
95
96
97sub implementor
98
# spent 373µs within URI::implementor which was called 11 times, avg 34µs/call: # 11 times (373µs+0s) by URI::new at line 59, avg 34µs/call
{
991126µs my($scheme, $impclass) = @_;
1001121µs if (!$scheme || $scheme !~ /\A$scheme_re\z/o) {
1011133µs require URI::_generic;
10211475µs return "URI::_generic";
103 }
104
105 $scheme = lc($scheme);
106
107 if ($impclass) {
108 # Set the implementor class for a given scheme
109 my $old = $implements{$scheme};
110 $impclass->_init_implementor($scheme);
111 $implements{$scheme} = $impclass;
112 return $old;
113 }
114
115 my $ic = $implements{$scheme};
116 return $ic if $ic;
117
118 # scheme not yet known, look for internal or
119 # preloaded (with 'use') implementation
120 $ic = "URI::$scheme"; # default location
121
122 # turn scheme into a valid perl identifier by a simple transformation...
123 $ic =~ s/\+/_P/g;
124 $ic =~ s/\./_O/g;
125 $ic =~ s/\-/_/g;
126
12731.69ms284µs
# spent 54µs (23+30) within URI::BEGIN@127 which was called # once (23µs+30µs) by HTTP::Body::BEGIN@24 at line 127
no strict 'refs';
# spent 54µs making 1 call to URI::BEGIN@127 # spent 30µs making 1 call to strict::unimport
128 # check we actually have one for the scheme:
129 unless (@{"${ic}::ISA"}) {
130 # Try to load it
131 eval "require $ic";
132 die $@ if $@ && $@ !~ /Can\'t locate.*in \@INC/;
133 return unless @{"${ic}::ISA"};
134 }
135
136 $ic->_init_implementor($scheme);
137 $implements{$scheme} = $ic;
138 $ic;
139}
140
141
142sub _init_implementor
143{
144 my($class, $scheme) = @_;
145 # Remember that one implementor class may actually
146 # serve to implement several URI schemes.
147}
148
149
150sub clone
151
# spent 114µs within URI::clone which was called 9 times, avg 13µs/call: # 9 times (114µs+0s) by URI::canonical at line 298, avg 13µs/call
{
152917µs my $self = shift;
153921µs my $other = $$self;
1549155µs bless \$other, ref $self;
155}
156
157
158sub _no_scheme_ok { 0 }
159
160sub _scheme
161
# spent 406µs (323+83) within URI::_scheme which was called 12 times, avg 34µs/call: # 12 times (323µs+83µs) by URI::canonical at line 293, avg 34µs/call
{
1621219µs my $self = shift;
163
1641221µs unless (@_) {
16512314µs2483µs return unless $$self =~ /^($scheme_re):/o;
# spent 48µs making 12 calls to URI::CORE:regcomp, avg 4µs/call # spent 35µs making 12 calls to URI::CORE:match, avg 3µs/call
166170µs return $1;
167 }
168
169 my $old;
170 my $new = shift;
171 if (defined($new) && length($new)) {
172 Carp::croak("Bad scheme '$new'") unless $new =~ /^$scheme_re$/o;
173 $old = $1 if $$self =~ s/^($scheme_re)://o;
174 my $newself = URI->new("$new:$$self");
175 $$self = $$newself;
176 bless $self, ref($newself);
177 }
178 else {
179 if ($self->_no_scheme_ok) {
180 $old = $1 if $$self =~ s/^($scheme_re)://o;
181 Carp::carp("Oops, opaque part now look like scheme")
182 if $^W && $$self =~ m/^$scheme_re:/o
183 }
184 else {
185 $old = $1 if $$self =~ m/^($scheme_re):/o;
186 }
187 }
188
189 return $old;
190}
191
192sub scheme
193{
194 my $scheme = shift->_scheme(@_);
195 return unless defined $scheme;
196 lc($scheme);
197}
198
199
200sub opaque
201{
202 my $self = shift;
203
204 unless (@_) {
205 $$self =~ /^(?:$scheme_re:)?([^\#]*)/o or die;
206 return $1;
207 }
208
209 $$self =~ /^($scheme_re:)? # optional scheme
210 ([^\#]*) # opaque
211 (\#.*)? # optional fragment
212 $/sx or die;
213
214 my $old_scheme = $1;
215 my $old_opaque = $2;
216 my $old_frag = $3;
217
218 my $new_opaque = shift;
219 $new_opaque = "" unless defined $new_opaque;
220 $new_opaque =~ s/([^$uric])/ URI::Escape::escape_char($1)/ego;
221
222 $$self = defined($old_scheme) ? $old_scheme : "";
223 $$self .= $new_opaque;
224 $$self .= $old_frag if defined $old_frag;
225
226 $old_opaque;
227}
228
22913µs*path = \&opaque; # alias
230
231
232sub fragment
233{
234 my $self = shift;
235 unless (@_) {
236 return unless $$self =~ /\#(.*)/s;
237 return $1;
238 }
239
240 my $old;
241 $old = $1 if $$self =~ s/\#(.*)//s;
242
243 my $new_frag = shift;
244 if (defined $new_frag) {
245 $new_frag =~ s/([^$uric])/ URI::Escape::escape_char($1) /ego;
246 $$self .= "#$new_frag";
247 }
248 $old;
249}
250
251
252sub as_string
253{
254 my $self = shift;
255 $$self;
256}
257
258
259sub as_iri
260{
261 my $self = shift;
262 my $str = $$self;
263 if ($str =~ s/%([89a-fA-F][0-9a-fA-F])/chr(hex($1))/eg) {
264 # All this crap because the more obvious:
265 #
266 # Encode::decode("UTF-8", $str, sub { sprintf "%%%02X", shift })
267 #
268 # doesn't work before Encode 2.39. Wait for a standard release
269 # to bundle that version.
270
271 require Encode;
272 my $enc = Encode::find_encoding("UTF-8");
273 my $u = "";
274 while (length $str) {
275 $u .= $enc->decode($str, Encode::FB_QUIET());
276 if (length $str) {
277 # escape next char
278 $u .= URI::Escape::escape_char(substr($str, 0, 1, ""));
279 }
280 }
281 $str = $u;
282 }
283 return $str;
284}
285
286
287sub canonical
288
# spent 2.31ms (1.37+944µs) within URI::canonical which was called 12 times, avg 193µs/call: # 11 times (1.32ms+841µs) by Catalyst::DispatchType::Path::register_path at line 120 of Catalyst/DispatchType/Path.pm, avg 196µs/call # once (50µs+102µs) by URI::_server::canonical at line 148 of URI/_server.pm
{
289 # Make sure scheme is lowercased, that we don't escape unreserved chars,
290 # and that we use upcase escape sequences.
291
2921225µs my $self = shift;
29312108µs12406µs my $scheme = $self->_scheme || "";
# spent 406µs making 12 calls to URI::_scheme, avg 34µs/call
2941292µs1219µs my $uc_scheme = $scheme =~ /[A-Z]/;
# spent 19µs making 12 calls to URI::CORE:match, avg 2µs/call
29512301µs1269µs my $esc = $$self =~ /%[a-fA-F0-9]{2}/;
# spent 69µs making 12 calls to URI::CORE:match, avg 6µs/call
2961243µs return $self unless $uc_scheme || $esc;
297
298972µs9114µs my $other = $self->clone;
# spent 114µs making 9 calls to URI::clone, avg 13µs/call
299913µs if ($uc_scheme) {
300 $other->_scheme(lc $scheme);
301 }
302929µs if ($esc) {
30329632µs38248µs $$other =~ s{%([0-9a-fA-F]{2})}
# spent 182µs making 29 calls to URI::CORE:substcont, avg 6µs/call # spent 66µs making 9 calls to URI::CORE:subst, avg 7µs/call
30420321µs4088µs { my $a = chr(hex($1));
# spent 51µs making 20 calls to URI::CORE:match, avg 3µs/call # spent 36µs making 20 calls to URI::CORE:regcomp, avg 2µs/call
305 $a =~ /^[$unreserved]\z/o ? $a : "%\U$1"
306 }ge;
307 }
308980µs return $other;
309}
310
311# Compare two URIs, subclasses will provide a more correct implementation
312sub eq {
313 my($self, $other) = @_;
314 $self = URI->new($self, $other) unless ref $self;
315 $other = URI->new($other, $self) unless ref $other;
316 ref($self) eq ref($other) && # same class
317 $self->canonical->as_string eq $other->canonical->as_string;
318}
319
320# generic-URI transformation methods
321sub abs { $_[0]; }
322sub rel { $_[0]; }
323
324sub secure { 0 }
325
326# help out Storable
327sub STORABLE_freeze {
328 my($self, $cloning) = @_;
329 return $$self;
330}
331
332sub STORABLE_thaw {
333 my($self, $cloning, $str) = @_;
334 $$self = $str;
335}
336
337111µs1;
338
339__END__
340
341=head1 NAME
342
343URI - Uniform Resource Identifiers (absolute and relative)
344
345=head1 SYNOPSIS
346
347 $u1 = URI->new("http://www.perl.com");
348 $u2 = URI->new("foo", "http");
349 $u3 = $u2->abs($u1);
350 $u4 = $u3->clone;
351 $u5 = URI->new("HTTP://WWW.perl.com:80")->canonical;
352
353 $str = $u->as_string;
354 $str = "$u";
355
356 $scheme = $u->scheme;
357 $opaque = $u->opaque;
358 $path = $u->path;
359 $frag = $u->fragment;
360
361 $u->scheme("ftp");
362 $u->host("ftp.perl.com");
363 $u->path("cpan/");
364
365=head1 DESCRIPTION
366
367This module implements the C<URI> class. Objects of this class
368represent "Uniform Resource Identifier references" as specified in RFC
3692396 (and updated by RFC 2732).
370
371A Uniform Resource Identifier is a compact string of characters that
372identifies an abstract or physical resource. A Uniform Resource
373Identifier can be further classified as either a Uniform Resource Locator
374(URL) or a Uniform Resource Name (URN). The distinction between URL
375and URN does not matter to the C<URI> class interface. A
376"URI-reference" is a URI that may have additional information attached
377in the form of a fragment identifier.
378
379An absolute URI reference consists of three parts: a I<scheme>, a
380I<scheme-specific part> and a I<fragment> identifier. A subset of URI
381references share a common syntax for hierarchical namespaces. For
382these, the scheme-specific part is further broken down into
383I<authority>, I<path> and I<query> components. These URIs can also
384take the form of relative URI references, where the scheme (and
385usually also the authority) component is missing, but implied by the
386context of the URI reference. The three forms of URI reference
387syntax are summarized as follows:
388
389 <scheme>:<scheme-specific-part>#<fragment>
390 <scheme>://<authority><path>?<query>#<fragment>
391 <path>?<query>#<fragment>
392
393The components into which a URI reference can be divided depend on the
394I<scheme>. The C<URI> class provides methods to get and set the
395individual components. The methods available for a specific
396C<URI> object depend on the scheme.
397
398=head1 CONSTRUCTORS
399
400The following methods construct new C<URI> objects:
401
402=over 4
403
404=item $uri = URI->new( $str )
405
406=item $uri = URI->new( $str, $scheme )
407
408Constructs a new URI object. The string
409representation of a URI is given as argument, together with an optional
410scheme specification. Common URI wrappers like "" and <>, as well as
411leading and trailing white space, are automatically removed from
412the $str argument before it is processed further.
413
414The constructor determines the scheme, maps this to an appropriate
415URI subclass, constructs a new object of that class and returns it.
416
417The $scheme argument is only used when $str is a
418relative URI. It can be either a simple string that
419denotes the scheme, a string containing an absolute URI reference, or
420an absolute C<URI> object. If no $scheme is specified for a relative
421URI $str, then $str is simply treated as a generic URI (no scheme-specific
422methods available).
423
424The set of characters available for building URI references is
425restricted (see L<URI::Escape>). Characters outside this set are
426automatically escaped by the URI constructor.
427
428=item $uri = URI->new_abs( $str, $base_uri )
429
430Constructs a new absolute URI object. The $str argument can
431denote a relative or absolute URI. If relative, then it is
432absolutized using $base_uri as base. The $base_uri must be an absolute
433URI.
434
435=item $uri = URI::file->new( $filename )
436
437=item $uri = URI::file->new( $filename, $os )
438
439Constructs a new I<file> URI from a file name. See L<URI::file>.
440
441=item $uri = URI::file->new_abs( $filename )
442
443=item $uri = URI::file->new_abs( $filename, $os )
444
445Constructs a new absolute I<file> URI from a file name. See
446L<URI::file>.
447
448=item $uri = URI::file->cwd
449
450Returns the current working directory as a I<file> URI. See
451L<URI::file>.
452
453=item $uri->clone
454
455Returns a copy of the $uri.
456
457=back
458
459=head1 COMMON METHODS
460
461The methods described in this section are available for all C<URI>
462objects.
463
464Methods that give access to components of a URI always return the
465old value of the component. The value returned is C<undef> if the
466component was not present. There is generally a difference between a
467component that is empty (represented as C<"">) and a component that is
468missing (represented as C<undef>). If an accessor method is given an
469argument, it updates the corresponding component in addition to
470returning the old value of the component. Passing an undefined
471argument removes the component (if possible). The description of
472each accessor method indicates whether the component is passed as
473an escaped or an unescaped string. A component that can be further
474divided into sub-parts are usually passed escaped, as unescaping might
475change its semantics.
476
477The common methods available for all URI are:
478
479=over 4
480
481=item $uri->scheme
482
483=item $uri->scheme( $new_scheme )
484
485Sets and returns the scheme part of the $uri. If the $uri is
486relative, then $uri->scheme returns C<undef>. If called with an
487argument, it updates the scheme of $uri, possibly changing the
488class of $uri, and returns the old scheme value. The method croaks
489if the new scheme name is illegal; a scheme name must begin with a
490letter and must consist of only US-ASCII letters, numbers, and a few
491special marks: ".", "+", "-". This restriction effectively means
492that the scheme must be passed unescaped. Passing an undefined
493argument to the scheme method makes the URI relative (if possible).
494
495Letter case does not matter for scheme names. The string
496returned by $uri->scheme is always lowercase. If you want the scheme
497just as it was written in the URI in its original case,
498you can use the $uri->_scheme method instead.
499
500=item $uri->opaque
501
502=item $uri->opaque( $new_opaque )
503
504Sets and returns the scheme-specific part of the $uri
505(everything between the scheme and the fragment)
506as an escaped string.
507
508=item $uri->path
509
510=item $uri->path( $new_path )
511
512Sets and returns the same value as $uri->opaque unless the URI
513supports the generic syntax for hierarchical namespaces.
514In that case the generic method is overridden to set and return
515the part of the URI between the I<host name> and the I<fragment>.
516
517=item $uri->fragment
518
519=item $uri->fragment( $new_frag )
520
521Returns the fragment identifier of a URI reference
522as an escaped string.
523
524=item $uri->as_string
525
526Returns a URI object to a plain ASCII string. URI objects are
527also converted to plain strings automatically by overloading. This
528means that $uri objects can be used as plain strings in most Perl
529constructs.
530
531=item $uri->as_iri
532
533Returns a Unicode string representing the URI. Escaped UTF-8 sequences
534representing non-ASCII characters are turned into their corresponding Unicode
535code point.
536
537=item $uri->canonical
538
539Returns a normalized version of the URI. The rules
540for normalization are scheme-dependent. They usually involve
541lowercasing the scheme and Internet host name components,
542removing the explicit port specification if it matches the default port,
543uppercasing all escape sequences, and unescaping octets that can be
544better represented as plain characters.
545
546For efficiency reasons, if the $uri is already in normalized form,
547then a reference to it is returned instead of a copy.
548
549=item $uri->eq( $other_uri )
550
551=item URI::eq( $first_uri, $other_uri )
552
553Tests whether two URI references are equal. URI references
554that normalize to the same string are considered equal. The method
555can also be used as a plain function which can also test two string
556arguments.
557
558If you need to test whether two C<URI> object references denote the
559same object, use the '==' operator.
560
561=item $uri->abs( $base_uri )
562
563Returns an absolute URI reference. If $uri is already
564absolute, then a reference to it is simply returned. If the $uri
565is relative, then a new absolute URI is constructed by combining the
566$uri and the $base_uri, and returned.
567
568=item $uri->rel( $base_uri )
569
570Returns a relative URI reference if it is possible to
571make one that denotes the same resource relative to $base_uri.
572If not, then $uri is simply returned.
573
574=item $uri->secure
575
576Returns a TRUE value if the URI is considered to point to a resource on
577a secure channel, such as an SSL or TLS encrypted one.
578
579=back
580
581=head1 GENERIC METHODS
582
583The following methods are available to schemes that use the
584common/generic syntax for hierarchical namespaces. The descriptions of
585schemes below indicate which these are. Unknown schemes are
586assumed to support the generic syntax, and therefore the following
587methods:
588
589=over 4
590
591=item $uri->authority
592
593=item $uri->authority( $new_authority )
594
595Sets and returns the escaped authority component
596of the $uri.
597
598=item $uri->path
599
600=item $uri->path( $new_path )
601
602Sets and returns the escaped path component of
603the $uri (the part between the host name and the query or fragment).
604The path can never be undefined, but it can be the empty string.
605
606=item $uri->path_query
607
608=item $uri->path_query( $new_path_query )
609
610Sets and returns the escaped path and query
611components as a single entity. The path and the query are
612separated by a "?" character, but the query can itself contain "?".
613
614=item $uri->path_segments
615
616=item $uri->path_segments( $segment, ... )
617
618Sets and returns the path. In a scalar context, it returns
619the same value as $uri->path. In a list context, it returns the
620unescaped path segments that make up the path. Path segments that
621have parameters are returned as an anonymous array. The first element
622is the unescaped path segment proper; subsequent elements are escaped
623parameter strings. Such an anonymous array uses overloading so it can
624be treated as a string too, but this string does not include the
625parameters.
626
627Note that absolute paths have the empty string as their first
628I<path_segment>, i.e. the I<path> C</foo/bar> have 3
629I<path_segments>; "", "foo" and "bar".
630
631=item $uri->query
632
633=item $uri->query( $new_query )
634
635Sets and returns the escaped query component of
636the $uri.
637
638=item $uri->query_form
639
640=item $uri->query_form( $key1 => $val1, $key2 => $val2, ... )
641
642=item $uri->query_form( $key1 => $val1, $key2 => $val2, ..., $delim )
643
644=item $uri->query_form( \@key_value_pairs )
645
646=item $uri->query_form( \@key_value_pairs, $delim )
647
648=item $uri->query_form( \%hash )
649
650=item $uri->query_form( \%hash, $delim )
651
652Sets and returns query components that use the
653I<application/x-www-form-urlencoded> format. Key/value pairs are
654separated by "&", and the key is separated from the value by a "="
655character.
656
657The form can be set either by passing separate key/value pairs, or via
658an array or hash reference. Passing an empty array or an empty hash
659removes the query component, whereas passing no arguments at all leaves
660the component unchanged. The order of keys is undefined if a hash
661reference is passed. The old value is always returned as a list of
662separate key/value pairs. Assigning this list to a hash is unwise as
663the keys returned might repeat.
664
665The values passed when setting the form can be plain strings or
666references to arrays of strings. Passing an array of values has the
667same effect as passing the key repeatedly with one value at a time.
668All the following statements have the same effect:
669
670 $uri->query_form(foo => 1, foo => 2);
671 $uri->query_form(foo => [1, 2]);
672 $uri->query_form([ foo => 1, foo => 2 ]);
673 $uri->query_form([ foo => [1, 2] ]);
674 $uri->query_form({ foo => [1, 2] });
675
676The $delim parameter can be passed as ";" to force the key/value pairs
677to be delimited by ";" instead of "&" in the query string. This
678practice is often recommended for URLs embedded in HTML or XML
679documents as this avoids the trouble of escaping the "&" character.
680You might also set the $URI::DEFAULT_QUERY_FORM_DELIMITER variable to
681";" for the same global effect.
682
683The C<URI::QueryParam> module can be loaded to add further methods to
684manipulate the form of a URI. See L<URI::QueryParam> for details.
685
686=item $uri->query_keywords
687
688=item $uri->query_keywords( $keywords, ... )
689
690=item $uri->query_keywords( \@keywords )
691
692Sets and returns query components that use the
693keywords separated by "+" format.
694
695The keywords can be set either by passing separate keywords directly
696or by passing a reference to an array of keywords. Passing an empty
697array removes the query component, whereas passing no arguments at
698all leaves the component unchanged. The old value is always returned
699as a list of separate words.
700
701=back
702
703=head1 SERVER METHODS
704
705For schemes where the I<authority> component denotes an Internet host,
706the following methods are available in addition to the generic
707methods.
708
709=over 4
710
711=item $uri->userinfo
712
713=item $uri->userinfo( $new_userinfo )
714
715Sets and returns the escaped userinfo part of the
716authority component.
717
718For some schemes this is a user name and a password separated by
719a colon. This practice is not recommended. Embedding passwords in
720clear text (such as URI) has proven to be a security risk in almost
721every case where it has been used.
722
723=item $uri->host
724
725=item $uri->host( $new_host )
726
727Sets and returns the unescaped hostname.
728
729If the $new_host string ends with a colon and a number, then this
730number also sets the port.
731
732For IPv6 addresses the brackets around the raw address is removed in the return
733value from $uri->host. When setting the host attribute to an IPv6 address you
734can use a raw address or one enclosed in brackets. The address needs to be
735enclosed in brackets if you want to pass in a new port value as well.
736
737=item $uri->ihost
738
739Returns the host in Unicode form. Any IDNA A-labels are turned into U-labels.
740
741=item $uri->port
742
743=item $uri->port( $new_port )
744
745Sets and returns the port. The port is a simple integer
746that should be greater than 0.
747
748If a port is not specified explicitly in the URI, then the URI scheme's default port
749is returned. If you don't want the default port
750substituted, then you can use the $uri->_port method instead.
751
752=item $uri->host_port
753
754=item $uri->host_port( $new_host_port )
755
756Sets and returns the host and port as a single
757unit. The returned value includes a port, even if it matches the
758default port. The host part and the port part are separated by a
759colon: ":".
760
761For IPv6 addresses the bracketing is preserved; thus
762URI->new("http://[::1]/")->host_port returns "[::1]:80". Contrast this with
763$uri->host which will remove the brackets.
764
765=item $uri->default_port
766
767Returns the default port of the URI scheme to which $uri
768belongs. For I<http> this is the number 80, for I<ftp> this
769is the number 21, etc. The default port for a scheme can not be
770changed.
771
772=back
773
774=head1 SCHEME-SPECIFIC SUPPORT
775
776Scheme-specific support is provided for the following URI schemes. For C<URI>
777objects that do not belong to one of these, you can only use the common and
778generic methods.
779
780=over 4
781
782=item B<data>:
783
784The I<data> URI scheme is specified in RFC 2397. It allows inclusion
785of small data items as "immediate" data, as if it had been included
786externally.
787
788C<URI> objects belonging to the data scheme support the common methods
789and two new methods to access their scheme-specific components:
790$uri->media_type and $uri->data. See L<URI::data> for details.
791
792=item B<file>:
793
794An old specification of the I<file> URI scheme is found in RFC 1738.
795A new RFC 2396 based specification in not available yet, but file URI
796references are in common use.
797
798C<URI> objects belonging to the file scheme support the common and
799generic methods. In addition, they provide two methods for mapping file URIs
800back to local file names; $uri->file and $uri->dir. See L<URI::file>
801for details.
802
803=item B<ftp>:
804
805An old specification of the I<ftp> URI scheme is found in RFC 1738. A
806new RFC 2396 based specification in not available yet, but ftp URI
807references are in common use.
808
809C<URI> objects belonging to the ftp scheme support the common,
810generic and server methods. In addition, they provide two methods for
811accessing the userinfo sub-components: $uri->user and $uri->password.
812
813=item B<gopher>:
814
815The I<gopher> URI scheme is specified in
816<draft-murali-url-gopher-1996-12-04> and will hopefully be available
817as a RFC 2396 based specification.
818
819C<URI> objects belonging to the gopher scheme support the common,
820generic and server methods. In addition, they support some methods for
821accessing gopher-specific path components: $uri->gopher_type,
822$uri->selector, $uri->search, $uri->string.
823
824=item B<http>:
825
826The I<http> URI scheme is specified in RFC 2616.
827The scheme is used to reference resources hosted by HTTP servers.
828
829C<URI> objects belonging to the http scheme support the common,
830generic and server methods.
831
832=item B<https>:
833
834The I<https> URI scheme is a Netscape invention which is commonly
835implemented. The scheme is used to reference HTTP servers through SSL
836connections. Its syntax is the same as http, but the default
837port is different.
838
839=item B<ldap>:
840
841The I<ldap> URI scheme is specified in RFC 2255. LDAP is the
842Lightweight Directory Access Protocol. An ldap URI describes an LDAP
843search operation to perform to retrieve information from an LDAP
844directory.
845
846C<URI> objects belonging to the ldap scheme support the common,
847generic and server methods as well as ldap-specific methods: $uri->dn,
848$uri->attributes, $uri->scope, $uri->filter, $uri->extensions. See
849L<URI::ldap> for details.
850
851=item B<ldapi>:
852
853Like the I<ldap> URI scheme, but uses a UNIX domain socket. The
854server methods are not supported, and the local socket path is
855available as $uri->un_path. The I<ldapi> scheme is used by the
856OpenLDAP package. There is no real specification for it, but it is
857mentioned in various OpenLDAP manual pages.
858
859=item B<ldaps>:
860
861Like the I<ldap> URI scheme, but uses an SSL connection. This
862scheme is deprecated, as the preferred way is to use the I<start_tls>
863mechanism.
864
865=item B<mailto>:
866
867The I<mailto> URI scheme is specified in RFC 2368. The scheme was
868originally used to designate the Internet mailing address of an
869individual or service. It has (in RFC 2368) been extended to allow
870setting of other mail header fields and the message body.
871
872C<URI> objects belonging to the mailto scheme support the common
873methods and the generic query methods. In addition, they support the
874following mailto-specific methods: $uri->to, $uri->headers.
875
876Note that the "foo@example.com" part of a mailto is I<not> the
877C<userinfo> and C<host> but instead the C<path>. This allows a
878mailto URI to contain multiple comma separated email addresses.
879
880=item B<mms>:
881
882The I<mms> URL specification can be found at L<http://sdp.ppona.com/>.
883C<URI> objects belonging to the mms scheme support the common,
884generic, and server methods, with the exception of userinfo and
885query-related sub-components.
886
887=item B<news>:
888
889The I<news>, I<nntp> and I<snews> URI schemes are specified in
890<draft-gilman-news-url-01> and will hopefully be available as an RFC
8912396 based specification soon.
892
893C<URI> objects belonging to the news scheme support the common,
894generic and server methods. In addition, they provide some methods to
895access the path: $uri->group and $uri->message.
896
897=item B<nntp>:
898
899See I<news> scheme.
900
901=item B<pop>:
902
903The I<pop> URI scheme is specified in RFC 2384. The scheme is used to
904reference a POP3 mailbox.
905
906C<URI> objects belonging to the pop scheme support the common, generic
907and server methods. In addition, they provide two methods to access the
908userinfo components: $uri->user and $uri->auth
909
910=item B<rlogin>:
911
912An old specification of the I<rlogin> URI scheme is found in RFC
9131738. C<URI> objects belonging to the rlogin scheme support the
914common, generic and server methods.
915
916=item B<rtsp>:
917
918The I<rtsp> URL specification can be found in section 3.2 of RFC 2326.
919C<URI> objects belonging to the rtsp scheme support the common,
920generic, and server methods, with the exception of userinfo and
921query-related sub-components.
922
923=item B<rtspu>:
924
925The I<rtspu> URI scheme is used to talk to RTSP servers over UDP
926instead of TCP. The syntax is the same as rtsp.
927
928=item B<rsync>:
929
930Information about rsync is available from L<http://rsync.samba.org/>.
931C<URI> objects belonging to the rsync scheme support the common,
932generic and server methods. In addition, they provide methods to
933access the userinfo sub-components: $uri->user and $uri->password.
934
935=item B<sip>:
936
937The I<sip> URI specification is described in sections 19.1 and 25
938of RFC 3261. C<URI> objects belonging to the sip scheme support the
939common, generic, and server methods with the exception of path related
940sub-components. In addition, they provide two methods to get and set
941I<sip> parameters: $uri->params_form and $uri->params.
942
943=item B<sips>:
944
945See I<sip> scheme. Its syntax is the same as sip, but the default
946port is different.
947
948=item B<snews>:
949
950See I<news> scheme. Its syntax is the same as news, but the default
951port is different.
952
953=item B<telnet>:
954
955An old specification of the I<telnet> URI scheme is found in RFC
9561738. C<URI> objects belonging to the telnet scheme support the
957common, generic and server methods.
958
959=item B<tn3270>:
960
961These URIs are used like I<telnet> URIs but for connections to IBM
962mainframes. C<URI> objects belonging to the tn3270 scheme support the
963common, generic and server methods.
964
965=item B<ssh>:
966
967Information about ssh is available at L<http://www.openssh.com/>.
968C<URI> objects belonging to the ssh scheme support the common,
969generic and server methods. In addition, they provide methods to
970access the userinfo sub-components: $uri->user and $uri->password.
971
972=item B<urn>:
973
974The syntax of Uniform Resource Names is specified in RFC 2141. C<URI>
975objects belonging to the urn scheme provide the common methods, and also the
976methods $uri->nid and $uri->nss, which return the Namespace Identifier
977and the Namespace-Specific String respectively.
978
979The Namespace Identifier basically works like the Scheme identifier of
980URIs, and further divides the URN namespace. Namespace Identifier
981assignments are maintained at
982L<http://www.iana.org/assignments/urn-namespaces>.
983
984Letter case is not significant for the Namespace Identifier. It is
985always returned in lower case by the $uri->nid method. The $uri->_nid
986method can be used if you want it in its original case.
987
988=item B<urn>:B<isbn>:
989
990The C<urn:isbn:> namespace contains International Standard Book
991Numbers (ISBNs) and is described in RFC 3187. A C<URI> object belonging
992to this namespace has the following extra methods (if the
993Business::ISBN module is available): $uri->isbn,
994$uri->isbn_publisher_code, $uri->isbn_group_code (formerly isbn_country_code,
995which is still supported by issues a deprecation warning), $uri->isbn_as_ean.
996
997=item B<urn>:B<oid>:
998
999The C<urn:oid:> namespace contains Object Identifiers (OIDs) and is
1000described in RFC 3061. An object identifier consists of sequences of digits
1001separated by dots. A C<URI> object belonging to this namespace has an
1002additional method called $uri->oid that can be used to get/set the oid
1003value. In a list context, oid numbers are returned as separate elements.
1004
1005=back
1006
1007=head1 CONFIGURATION VARIABLES
1008
1009The following configuration variables influence how the class and its
1010methods behave:
1011
1012=over 4
1013
1014=item $URI::ABS_ALLOW_RELATIVE_SCHEME
1015
1016Some older parsers used to allow the scheme name to be present in the
1017relative URL if it was the same as the base URL scheme. RFC 2396 says
1018that this should be avoided, but you can enable this old behaviour by
1019setting the $URI::ABS_ALLOW_RELATIVE_SCHEME variable to a TRUE value.
1020The difference is demonstrated by the following examples:
1021
1022 URI->new("http:foo")->abs("http://host/a/b")
1023 ==> "http:foo"
1024
1025 local $URI::ABS_ALLOW_RELATIVE_SCHEME = 1;
1026 URI->new("http:foo")->abs("http://host/a/b")
1027 ==> "http:/host/a/foo"
1028
1029
1030=item $URI::ABS_REMOTE_LEADING_DOTS
1031
1032You can also have the abs() method ignore excess ".."
1033segments in the relative URI by setting $URI::ABS_REMOTE_LEADING_DOTS
1034to a TRUE value. The difference is demonstrated by the following
1035examples:
1036
1037 URI->new("../../../foo")->abs("http://host/a/b")
1038 ==> "http://host/../../foo"
1039
1040 local $URI::ABS_REMOTE_LEADING_DOTS = 1;
1041 URI->new("../../../foo")->abs("http://host/a/b")
1042 ==> "http://host/foo"
1043
1044=item $URI::DEFAULT_QUERY_FORM_DELIMITER
1045
1046This value can be set to ";" to have the query form C<key=value> pairs
1047delimited by ";" instead of "&" which is the default.
1048
1049=back
1050
1051=head1 BUGS
1052
1053Using regexp variables like $1 directly as arguments to the URI methods
1054does not work too well with current perl implementations. I would argue
1055that this is actually a bug in perl. The workaround is to quote
1056them. Example:
1057
1058 /(...)/ || die;
1059 $u->query("$1");
1060
1061=head1 PARSING URIs WITH REGEXP
1062
1063As an alternative to this module, the following (official) regular
1064expression can be used to decode a URI:
1065
1066 my($scheme, $authority, $path, $query, $fragment) =
1067 $uri =~ m|(?:([^:/?#]+):)?(?://([^/?#]*))?([^?#]*)(?:\?([^#]*))?(?:#(.*))?|;
1068
1069The C<URI::Split> module provides the function uri_split() as a
1070readable alternative.
1071
1072=head1 SEE ALSO
1073
1074L<URI::file>, L<URI::WithBase>, L<URI::QueryParam>, L<URI::Escape>,
1075L<URI::Split>, L<URI::Heuristic>
1076
1077RFC 2396: "Uniform Resource Identifiers (URI): Generic Syntax",
1078Berners-Lee, Fielding, Masinter, August 1998.
1079
1080L<http://www.iana.org/assignments/uri-schemes>
1081
1082L<http://www.iana.org/assignments/urn-namespaces>
1083
1084L<http://www.w3.org/Addressing/>
1085
1086=head1 COPYRIGHT
1087
1088Copyright 1995-2009 Gisle Aas.
1089
1090Copyright 1995 Martijn Koster.
1091
1092This program is free software; you can redistribute it and/or modify
1093it under the same terms as Perl itself.
1094
1095=head1 AUTHORS / ACKNOWLEDGMENTS
1096
1097This module is based on the C<URI::URL> module, which in turn was
1098(distantly) based on the C<wwwurl.pl> code in the libwww-perl for
1099perl4 developed by Roy Fielding, as part of the Arcadia project at the
1100University of California, Irvine, with contributions from Brooks
1101Cutter.
1102
1103C<URI::URL> was developed by Gisle Aas, Tim Bunce, Roy Fielding and
1104Martijn Koster with input from other people on the libwww-perl mailing
1105list.
1106
1107C<URI> and related subclasses was developed by Gisle Aas.
1108
1109=cut
# spent 225µs within URI::CORE:match which was called 78 times, avg 3µs/call: # 20 times (51µs+0s) by URI::canonical at line 304 of URI.pm, avg 3µs/call # 12 times (69µs+0s) by URI::canonical at line 295 of URI.pm, avg 6µs/call # 12 times (35µs+0s) by URI::_scheme at line 165 of URI.pm, avg 3µs/call # 12 times (19µs+0s) by URI::canonical at line 294 of URI.pm, avg 2µs/call # 11 times (26µs+0s) by URI::_init at line 82 of URI.pm, avg 2µs/call # 11 times (25µs+0s) by URI::new at line 47 of URI.pm, avg 2µs/call
sub URI::CORE:match; # xsub
# spent 247µs within URI::CORE:regcomp which was called 65 times, avg 4µs/call: # 20 times (36µs+0s) by URI::canonical at line 304 of URI.pm, avg 2µs/call # 12 times (48µs+0s) by URI::_scheme at line 165 of URI.pm, avg 4µs/call # 11 times (72µs+0s) by URI::_init at line 82 of URI.pm, avg 7µs/call # 11 times (65µs+0s) by URI::new at line 47 of URI.pm, avg 6µs/call # 11 times (26µs+0s) by URI::_uric_escape at line 92 of URI.pm, avg 2µs/call
sub URI::CORE:regcomp; # xsub
# spent 385µs within URI::CORE:subst which was called 64 times, avg 6µs/call: # 11 times (158µs+0s) by URI::new at line 41 of URI.pm, avg 14µs/call # 11 times (67µs+0s) by URI::_uric_escape at line 92 of URI.pm, avg 6µs/call # 11 times (46µs+0s) by URI::new at line 43 of URI.pm, avg 4µs/call # 11 times (30µs+0s) by URI::new at line 44 of URI.pm, avg 3µs/call # 11 times (18µs+0s) by URI::new at line 42 of URI.pm, avg 2µs/call # 9 times (66µs+0s) by URI::canonical at line 303 of URI.pm, avg 7µs/call
sub URI::CORE:subst; # xsub
# spent 309µs within URI::CORE:substcont which was called 58 times, avg 5µs/call: # 29 times (182µs+0s) by URI::canonical at line 303 of URI.pm, avg 6µs/call # 29 times (127µs+0s) by URI::_uric_escape at line 92 of URI.pm, avg 4µs/call
sub URI::CORE:substcont; # xsub