← Index
NYTProf Performance Profile   « line view »
For /Users/brian/bin/perls/cpan5.26.1
  Run on Sat Dec 30 01:41:10 2017
Reported on Sat Dec 30 01:44:15 2017

Filename/usr/local/perls/perl-5.26.1/lib/site_perl/5.26.1/URI/file/Base.pm
StatementsExecuted 9 statements in 890µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11133µs37µsURI::file::Base::::BEGIN@3URI::file::Base::BEGIN@3
11118µs31µsURI::file::Base::::BEGIN@4URI::file::Base::BEGIN@4
1117µs7µsURI::file::Base::::BEGIN@6URI::file::Base::BEGIN@6
0000s0sURI::file::Base::::_file_extract_authorityURI::file::Base::_file_extract_authority
0000s0sURI::file::Base::::_file_extract_pathURI::file::Base::_file_extract_path
0000s0sURI::file::Base::::_file_is_absoluteURI::file::Base::_file_is_absolute
0000s0sURI::file::Base::::_file_is_localhostURI::file::Base::_file_is_localhost
0000s0sURI::file::Base::::dirURI::file::Base::dir
0000s0sURI::file::Base::::fileURI::file::Base::file
0000s0sURI::file::Base::::newURI::file::Base::new
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package URI::file::Base;
2
3250µs241µs
# spent 37µs (33+4) within URI::file::Base::BEGIN@3 which was called: # once (33µs+4µs) by parent::import at line 3
use strict;
# spent 37µs making 1 call to URI::file::Base::BEGIN@3 # spent 4µs making 1 call to strict::import
4239µs244µs
# spent 31µs (18+13) within URI::file::Base::BEGIN@4 which was called: # once (18µs+13µs) by parent::import at line 4
use warnings;
# spent 31µs making 1 call to URI::file::Base::BEGIN@4 # spent 13µs making 1 call to warnings::import
5
62771µs17µs
# spent 7µs within URI::file::Base::BEGIN@6 which was called: # once (7µs+0s) by parent::import at line 6
use URI::Escape qw();
# spent 7µs making 1 call to URI::file::Base::BEGIN@6
7
810sour $VERSION = '1.72';
9126µs$VERSION = eval $VERSION;
# spent 6µs executing statements in string eval
10
11sub new
12{
13 my $class = shift;
14 my $path = shift;
15 $path = "" unless defined $path;
16
17 my($auth, $escaped_auth, $escaped_path);
18
19 ($auth, $escaped_auth) = $class->_file_extract_authority($path);
20 ($path, $escaped_path) = $class->_file_extract_path($path);
21
22 if (defined $auth) {
23 $auth =~ s,%,%25,g unless $escaped_auth;
24 $auth =~ s,([/?\#]), URI::Escape::escape_char($1),eg;
25 $auth = "//$auth";
26 if (defined $path) {
27 $path = "/$path" unless substr($path, 0, 1) eq "/";
28 } else {
29 $path = "";
30 }
31 } else {
32 return undef unless defined $path;
33 $auth = "";
34 }
35
36 $path =~ s,([%;?]), URI::Escape::escape_char($1),eg unless $escaped_path;
37 $path =~ s/\#/%23/g;
38
39 my $uri = $auth . $path;
40 $uri = "file:$uri" if substr($uri, 0, 1) eq "/";
41
42 URI->new($uri, "file");
43}
44
45sub _file_extract_authority
46{
47 my($class, $path) = @_;
48 return undef unless $class->_file_is_absolute($path);
49 return $URI::file::DEFAULT_AUTHORITY;
50}
51
52sub _file_extract_path
53{
54 return undef;
55}
56
57sub _file_is_absolute
58{
59 return 0;
60}
61
62sub _file_is_localhost
63{
64 shift; # class
65 my $host = lc(shift);
66 return 1 if $host eq "localhost";
67 eval {
68 require Net::Domain;
69 lc(Net::Domain::hostfqdn()) eq $host ||
70 lc(Net::Domain::hostname()) eq $host;
71 };
72}
73
74sub file
75{
76 undef;
77}
78
79sub dir
80{
81 my $self = shift;
82 $self->file(@_);
83}
84
8514µs1;