Filename | /home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/5.13.5/vars.pm |
Statements | Executed 1260 statements in 6.96ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
47 | 47 | 30 | 5.06ms | 6.34ms | import | vars::
798 | 3 | 1 | 1.28ms | 1.28ms | CORE:match (opcode) | vars::
1 | 1 | 1 | 233µs | 412µs | BEGIN@7 | vars::
1 | 1 | 1 | 31µs | 31µs | BEGIN@3 | vars::
1 | 1 | 1 | 9µs | 36µs | BEGIN@8 | vars::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package vars; | ||||
2 | |||||
3 | 2 | 45µs | 1 | 31µs | # spent 31µs within vars::BEGIN@3 which was called:
# once (31µs+0s) by Tie::RefHash::BEGIN@3 at line 3 # spent 31µs making 1 call to vars::BEGIN@3 |
4 | |||||
5 | 1 | 1µs | our $VERSION = '1.02'; | ||
6 | |||||
7 | 2 | 246µs | 2 | 590µs | # spent 412µs (233+178) within vars::BEGIN@7 which was called:
# once (233µs+178µs) by Tie::RefHash::BEGIN@3 at line 7 # spent 412µs making 1 call to vars::BEGIN@7
# spent 178µs making 1 call to warnings::register::import |
8 | 2 | 234µs | 2 | 62µs | # spent 36µs (9+26) within vars::BEGIN@8 which was called:
# once (9µs+26µs) by Tie::RefHash::BEGIN@3 at line 8 # spent 36µs making 1 call to vars::BEGIN@8
# spent 26µs making 1 call to strict::import |
9 | |||||
10 | # spent 6.34ms (5.06+1.28) within vars::import which was called 47 times, avg 135µs/call:
# once (728µs+191µs) by Regexp::Common::URI::RFC1738::BEGIN@33 at line 33 of Regexp/Common/URI/RFC1738.pm
# once (709µs+190µs) by Regexp::Common::URI::RFC2396::BEGIN@32 at line 32 of Regexp/Common/URI/RFC2396.pm
# once (646µs+170µs) by Regexp::Common::URI::RFC2806::BEGIN@42 at line 42 of Regexp/Common/URI/RFC2806.pm
# once (601µs+167µs) by Regexp::Common::URI::RFC1808::BEGIN@40 at line 40 of Regexp/Common/URI/RFC1808.pm
# once (209µs+55µs) by Regexp::Common::URI::RFC2384::BEGIN@28 at line 28 of Regexp/Common/URI/RFC2384.pm
# once (143µs+37µs) by Regexp::Common::URI::RFC1035::BEGIN@24 at line 24 of Regexp/Common/URI/RFC1035.pm
# once (142µs+26µs) by List::Util::BEGIN@12 at line 12 of List/Util.pm
# once (112µs+28µs) by List::MoreUtils::BEGIN@8 at line 8 of List/MoreUtils.pm
# once (92µs+23µs) by Text::Unidecode::BEGIN@7 at line 7 of Text/Unidecode.pm
# once (94µs+22µs) by Params::Util::BEGIN@65 at line 65 of Params/Util.pm
# once (89µs+23µs) by DBD::SQLite::BEGIN@9 at line 9 of DBD/SQLite.pm
# once (83µs+23µs) by Regexp::Common::BEGIN@19 at line 19 of Regexp/Common.pm
# once (82µs+19µs) by Regexp::Common::URI::RFC1808::BEGIN@19 at line 19 of Regexp/Common/URI/RFC1808.pm
# once (81µs+20µs) by Scalar::Util::BEGIN@10 at line 10 of Scalar/Util.pm
# once (81µs+19µs) by Regexp::Common::URI::RFC2396::BEGIN@11 at line 11 of Regexp/Common/URI/RFC2396.pm
# once (80µs+19µs) by Regexp::Common::URI::RFC1035::BEGIN@11 at line 11 of Regexp/Common/URI/RFC1035.pm
# once (79µs+19µs) by Regexp::Common::URI::RFC1738::BEGIN@11 at line 11 of Regexp/Common/URI/RFC1738.pm
# once (77µs+19µs) by Regexp::Common::URI::RFC2806::BEGIN@12 at line 12 of Regexp/Common/URI/RFC2806.pm
# once (76µs+19µs) by Regexp::Common::URI::RFC2384::BEGIN@13 at line 13 of Regexp/Common/URI/RFC2384.pm
# once (50µs+13µs) by DBD::SQLite::BEGIN@8 at line 8 of DBD/SQLite.pm
# once (49µs+13µs) by Tie::RefHash::Nestable::BEGIN@262 at line 262 of Tie/RefHash.pm
# once (46µs+14µs) by constant::BEGIN@6 at line 6 of constant.pm
# once (49µs+11µs) by Regexp::Common::URI::BEGIN@9 at line 9 of Regexp/Common/URI.pm
# once (32µs+8µs) by namespace::clean::BEGIN@13 at line 13 of namespace/clean.pm
# once (31µs+7µs) by Tie::RefHash::BEGIN@3 at line 3 of Tie/RefHash.pm
# once (28µs+7µs) by Regexp::Common::URI::file::BEGIN@10 at line 10 of Regexp/Common/URI/file.pm
# once (29µs+6µs) by Tie::RefHash::BEGIN@91 at line 91 of Tie/RefHash.pm
# once (28µs+6µs) by Regexp::Common::URI::ftp::BEGIN@11 at line 11 of Regexp/Common/URI/ftp.pm
# once (28µs+6µs) by Regexp::Common::URI::RFC1738::BEGIN@8 at line 8 of Regexp/Common/URI/RFC1738.pm
# once (28µs+6µs) by Regexp::Common::URI::RFC1808::BEGIN@16 at line 16 of Regexp/Common/URI/RFC1808.pm
# once (28µs+6µs) by Regexp::Common::URI::RFC2396::BEGIN@8 at line 8 of Regexp/Common/URI/RFC2396.pm
# once (28µs+6µs) by Regexp::Common::URI::RFC1035::BEGIN@8 at line 8 of Regexp/Common/URI/RFC1035.pm
# once (28µs+5µs) by Regexp::Common::URI::tv::BEGIN@13 at line 13 of Regexp/Common/URI/tv.pm
# once (28µs+5µs) by Regexp::Common::URI::fax::BEGIN@11 at line 11 of Regexp/Common/URI/fax.pm
# once (27µs+6µs) by Regexp::Common::URI::RFC2384::BEGIN@10 at line 10 of Regexp/Common/URI/RFC2384.pm
# once (27µs+6µs) by Regexp::Common::URI::tel::BEGIN@11 at line 11 of Regexp/Common/URI/tel.pm
# once (27µs+6µs) by Regexp::Common::URI::gopher::BEGIN@11 at line 11 of Regexp/Common/URI/gopher.pm
# once (26µs+6µs) by base::BEGIN@4 at line 4 of base.pm
# once (27µs+5µs) by Regexp::Common::URI::BEGIN@19 at line 19 of Regexp/Common/URI.pm
# once (27µs+6µs) by Regexp::Common::URI::wais::BEGIN@11 at line 11 of Regexp/Common/URI/wais.pm
# once (27µs+5µs) by Regexp::Common::URI::RFC2806::BEGIN@9 at line 9 of Regexp/Common/URI/RFC2806.pm
# once (26µs+6µs) by Regexp::Common::URI::http::BEGIN@10 at line 10 of Regexp/Common/URI/http.pm
# once (26µs+5µs) by Regexp::Common::URI::news::BEGIN@11 at line 11 of Regexp/Common/URI/news.pm
# once (26µs+6µs) by Regexp::Common::URI::pop::BEGIN@11 at line 11 of Regexp/Common/URI/pop.pm
# once (26µs+6µs) by Regexp::Common::URI::prospero::BEGIN@11 at line 11 of Regexp/Common/URI/prospero.pm
# once (26µs+6µs) by Regexp::Common::URI::telnet::BEGIN@10 at line 10 of Regexp/Common/URI/telnet.pm
# once (25µs+5µs) by DBD::SQLite::BEGIN@10 at line 10 of DBD/SQLite.pm | ||||
11 | 1252 | 6.43ms | my $callpack = caller; | ||
12 | my (undef, @imports) = @_; | ||||
13 | my ($sym, $ch); | ||||
14 | foreach (@imports) { | ||||
15 | 266 | 627µs | if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) { # spent 627µs making 266 calls to vars::CORE:match, avg 2µs/call | ||
16 | 266 | 340µs | if ($sym =~ /\W/) { # spent 340µs making 266 calls to vars::CORE:match, avg 1µs/call | ||
17 | # time for a more-detailed check-up | ||||
18 | if ($sym =~ /^\w+[[{].*[]}]$/) { | ||||
19 | require Carp; | ||||
20 | Carp::croak("Can't declare individual elements of hash or array"); | ||||
21 | } elsif (warnings::enabled() and length($sym) == 1 and $sym !~ tr/a-zA-Z//) { | ||||
22 | warnings::warn("No need to declare built-in vars"); | ||||
23 | } elsif (($^H &= strict::bits('vars'))) { | ||||
24 | require Carp; | ||||
25 | Carp::croak("'$_' is not a valid variable name under strict vars"); | ||||
26 | } | ||||
27 | } | ||||
28 | 266 | 315µs | $sym = "${callpack}::$sym" unless $sym =~ /::/; # spent 315µs making 266 calls to vars::CORE:match, avg 1µs/call | ||
29 | *$sym = | ||||
30 | ( $ch eq "\$" ? \$$sym | ||||
31 | : $ch eq "\@" ? \@$sym | ||||
32 | : $ch eq "\%" ? \%$sym | ||||
33 | : $ch eq "\*" ? \*$sym | ||||
34 | : $ch eq "\&" ? \&$sym | ||||
35 | : do { | ||||
36 | require Carp; | ||||
37 | Carp::croak("'$_' is not a valid variable name"); | ||||
38 | }); | ||||
39 | } else { | ||||
40 | require Carp; | ||||
41 | Carp::croak("'$_' is not a valid variable name"); | ||||
42 | } | ||||
43 | } | ||||
44 | }; | ||||
45 | |||||
46 | 1 | 3µs | 1; | ||
47 | __END__ | ||||
sub vars::CORE:match; # opcode |