Filename | /home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/5.13.5/vars.pm |
Statements | Executed 1536 statements in 8.32ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
59 | 59 | 37 | 6.06ms | 7.67ms | import | vars::
969 | 3 | 1 | 1.61ms | 1.61ms | CORE:match (opcode) | vars::
1 | 1 | 1 | 229µs | 406µs | BEGIN@7 | vars::
1 | 1 | 1 | 33µs | 33µs | BEGIN@3 | vars::
1 | 1 | 1 | 10µs | 34µs | BEGIN@8 | vars::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package vars; | ||||
2 | |||||
3 | 2 | 46µs | 1 | 33µs | # spent 33µs within vars::BEGIN@3 which was called:
# once (33µs+0s) by base::BEGIN@4 at line 3 # spent 33µs making 1 call to vars::BEGIN@3 |
4 | |||||
5 | 1 | 2µs | our $VERSION = '1.02'; | ||
6 | |||||
7 | 2 | 241µs | 2 | 584µs | # spent 406µs (229+178) within vars::BEGIN@7 which was called:
# once (229µs+178µs) by base::BEGIN@4 at line 7 # spent 406µs making 1 call to vars::BEGIN@7
# spent 178µs making 1 call to warnings::register::import |
8 | 2 | 232µs | 2 | 57µs | # spent 34µs (10+24) within vars::BEGIN@8 which was called:
# once (10µs+24µs) by base::BEGIN@4 at line 8 # spent 34µs making 1 call to vars::BEGIN@8
# spent 24µs making 1 call to strict::import |
9 | |||||
10 | # spent 7.67ms (6.06+1.61) within vars::import which was called 59 times, avg 130µs/call:
# once (703µs+221µs) by Regexp::Common::URI::RFC1738::BEGIN@33 at line 33 of Regexp/Common/URI/RFC1738.pm
# once (698µs+191µs) by Regexp::Common::URI::RFC2396::BEGIN@32 at line 32 of Regexp/Common/URI/RFC2396.pm
# once (649µs+171µs) by Regexp::Common::URI::RFC2806::BEGIN@42 at line 42 of Regexp/Common/URI/RFC2806.pm
# once (602µs+165µs) by Regexp::Common::URI::RFC1808::BEGIN@40 at line 40 of Regexp/Common/URI/RFC1808.pm
# once (209µs+57µs) by Regexp::Common::URI::RFC2384::BEGIN@28 at line 28 of Regexp/Common/URI/RFC2384.pm
# once (165µs+43µs) by Getopt::Long::BEGIN@45 at line 45 of Getopt/Long.pm
# once (163µs+43µs) by Params::Validate::BEGIN@7 at line 7 of Params/Validate.pm
# once (140µs+37µs) by Regexp::Common::URI::RFC1035::BEGIN@24 at line 24 of Regexp/Common/URI/RFC1035.pm
# once (126µs+34µs) by version::BEGIN@7 at line 7 of version.pm
# once (115µs+34µs) by Time::HiRes::BEGIN@4 at line 4 of Time/HiRes.pm
# once (103µs+28µs) by Getopt::Long::BEGIN@48 at line 48 of Getopt/Long.pm
# once (100µs+26µs) by Getopt::Long::BEGIN@51 at line 51 of Getopt/Long.pm
# once (96µs+25µs) by List::Util::BEGIN@12 at line 12 of List/Util.pm
# once (93µs+24µs) by Text::Unidecode::BEGIN@7 at line 7 of Text/Unidecode.pm
# once (89µs+26µs) by Scalar::Util::BEGIN@10 at line 10 of Scalar/Util.pm
# once (84µs+28µs) by DBD::SQLite::BEGIN@9 at line 9 of DBD/SQLite.pm
# once (86µs+22µs) by List::MoreUtils::BEGIN@8 at line 8 of List/MoreUtils.pm
# once (85µs+22µs) by Cwd::BEGIN@172 at line 172 of Cwd.pm
# once (83µs+21µs) by Regexp::Common::BEGIN@19 at line 19 of Regexp/Common.pm
# once (83µs+20µs) by Regexp::Common::URI::RFC2384::BEGIN@13 at line 13 of Regexp/Common/URI/RFC2384.pm
# once (80µs+20µs) by Params::Util::BEGIN@65 at line 65 of Params/Util.pm
# once (79µs+19µs) by Regexp::Common::URI::RFC1808::BEGIN@19 at line 19 of Regexp/Common/URI/RFC1808.pm
# once (78µs+19µs) by Regexp::Common::URI::RFC1738::BEGIN@11 at line 11 of Regexp/Common/URI/RFC1738.pm
# once (77µs+20µs) by Regexp::Common::URI::RFC1035::BEGIN@11 at line 11 of Regexp/Common/URI/RFC1035.pm
# once (77µs+19µs) by Regexp::Common::URI::RFC2396::BEGIN@11 at line 11 of Regexp/Common/URI/RFC2396.pm
# once (75µs+20µs) by Regexp::Common::URI::RFC2806::BEGIN@12 at line 12 of Regexp/Common/URI/RFC2806.pm
# once (70µs+19µs) by Getopt::Long::BEGIN@46 at line 46 of Getopt/Long.pm
# once (58µs+15µs) by Getopt::Long::BEGIN@26 at line 26 of Getopt/Long.pm
# once (57µs+14µs) by DBD::SQLite::BEGIN@8 at line 8 of DBD/SQLite.pm
# once (57µs+14µs) by File::Spec::BEGIN@4 at line 4 of File/Spec.pm
# once (51µs+15µs) by Regexp::Common::URI::BEGIN@9 at line 9 of Regexp/Common/URI.pm
# once (47µs+6µs) by Regexp::Common::URI::prospero::BEGIN@11 at line 11 of Regexp/Common/URI/prospero.pm
# once (41µs+11µs) by constant::BEGIN@6 at line 6 of constant.pm
# once (36µs+7µs) by Getopt::Long::BEGIN@19 at line 19 of Getopt/Long.pm
# once (33µs+9µs) by namespace::clean::BEGIN@13 at line 13 of namespace/clean.pm
# once (33µs+7µs) by Tie::RefHash::BEGIN@3 at line 3 of Tie/RefHash.pm
# once (28µs+9µs) by Regexp::Common::URI::RFC1035::BEGIN@8 at line 8 of Regexp/Common/URI/RFC1035.pm
# once (31µs+6µs) by Regexp::Common::URI::telnet::BEGIN@10 at line 10 of Regexp/Common/URI/telnet.pm
# once (30µs+6µs) by base::BEGIN@4 at line 4 of base.pm
# once (30µs+6µs) by Regexp::Common::URI::wais::BEGIN@11 at line 11 of Regexp/Common/URI/wais.pm
# once (30µs+6µs) by Regexp::Common::URI::tv::BEGIN@13 at line 13 of Regexp/Common/URI/tv.pm
# once (29µs+6µs) by Tie::RefHash::Nestable::BEGIN@262 at line 262 of Tie/RefHash.pm
# once (29µs+6µs) by Tie::RefHash::BEGIN@91 at line 91 of Tie/RefHash.pm
# once (28µs+7µs) by File::Spec::Unix::BEGIN@4 at line 4 of File/Spec/Unix.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::RFC2384::BEGIN@10 at line 10 of Regexp/Common/URI/RFC2384.pm
# once (28µs+5µs) by Regexp::Common::URI::RFC2806::BEGIN@9 at line 9 of Regexp/Common/URI/RFC2806.pm
# once (28µs+6µs) by Regexp::Common::URI::BEGIN@19 at line 19 of Regexp/Common/URI.pm
# once (27µs+6µs) by Regexp::Common::URI::RFC2396::BEGIN@8 at line 8 of Regexp/Common/URI/RFC2396.pm
# once (27µs+6µs) by Regexp::Common::URI::RFC1808::BEGIN@16 at line 16 of Regexp/Common/URI/RFC1808.pm
# once (27µs+6µs) by Regexp::Common::URI::fax::BEGIN@11 at line 11 of Regexp/Common/URI/fax.pm
# once (27µs+5µs) by Regexp::Common::URI::ftp::BEGIN@11 at line 11 of Regexp/Common/URI/ftp.pm
# once (27µs+5µs) by Regexp::Common::URI::file::BEGIN@10 at line 10 of Regexp/Common/URI/file.pm
# once (27µs+5µs) by Regexp::Common::URI::http::BEGIN@10 at line 10 of Regexp/Common/URI/http.pm
# once (27µs+5µs) by Regexp::Common::URI::news::BEGIN@11 at line 11 of Regexp/Common/URI/news.pm
# once (27µs+5µs) by Regexp::Common::URI::pop::BEGIN@11 at line 11 of Regexp/Common/URI/pop.pm
# once (26µs+5µs) by Regexp::Common::URI::gopher::BEGIN@11 at line 11 of Regexp/Common/URI/gopher.pm
# once (26µs+6µs) by Regexp::Common::URI::tel::BEGIN@11 at line 11 of Regexp/Common/URI/tel.pm
# once (26µs+5µs) by DBD::SQLite::BEGIN@10 at line 10 of DBD/SQLite.pm | ||||
11 | 59 | 96µs | my $callpack = caller; | ||
12 | 59 | 161µs | my (undef, @imports) = @_; | ||
13 | 59 | 65µs | my ($sym, $ch); | ||
14 | 59 | 416µs | foreach (@imports) { | ||
15 | 323 | 2.90ms | 323 | 793µs | if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) { # spent 793µs making 323 calls to vars::CORE:match, avg 2µs/call |
16 | 323 | 1.30ms | 323 | 416µs | if ($sym =~ /\W/) { # spent 416µs making 323 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 | 323 | 1.41ms | 323 | 398µs | $sym = "${callpack}::$sym" unless $sym =~ /::/; # spent 398µs making 323 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 | 323 | 1.45ms | : 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 |