Filename | /usr/lib/perl5/5.14/vars.pm |
Statements | Executed 444 statements in 6.59ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 2.75ms | 2.97ms | BEGIN@7 | vars::
27 | 27 | 25 | 2.01ms | 2.65ms | import | vars::
246 | 3 | 1 | 639µs | 639µs | CORE:match (opcode) | vars::
1 | 1 | 1 | 469µs | 469µs | BEGIN@3 | vars::
1 | 1 | 1 | 14µs | 42µs | BEGIN@8 | vars::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package vars; | ||||
2 | |||||
3 | 2 | 446µs | 1 | 469µs | # spent 469µs within vars::BEGIN@3 which was called:
# once (469µs+0s) by Config::BEGIN@11 at line 3 # spent 469µs making 1 call to vars::BEGIN@3 |
4 | |||||
5 | 1 | 1µs | our $VERSION = '1.02'; | ||
6 | |||||
7 | 2 | 2.79ms | 2 | 3.19ms | # spent 2.97ms (2.75+222µs) within vars::BEGIN@7 which was called:
# once (2.75ms+222µs) by Config::BEGIN@11 at line 7 # spent 2.97ms making 1 call to vars::BEGIN@7
# spent 222µs making 1 call to warnings::register::import |
8 | 2 | 620µs | 2 | 70µs | # spent 42µs (14+28) within vars::BEGIN@8 which was called:
# once (14µs+28µs) by Config::BEGIN@11 at line 8 # spent 42µs making 1 call to vars::BEGIN@8
# spent 28µs making 1 call to strict::import |
9 | |||||
10 | # spent 2.65ms (2.01+639µs) within vars::import which was called 27 times, avg 98µs/call:
# once (238µs+76µs) by File::stat::BEGIN@28 at line 28 of File/stat.pm
# once (121µs+39µs) by List::Util::BEGIN@12 at line 12 of List/Util.pm
# once (116µs+35µs) by File::Spec::Functions::BEGIN@6 at line 6 of File/Spec/Functions.pm
# once (107µs+31µs) by POSIX::SigRt::BEGIN@60 at line 60 of POSIX.pm
# once (99µs+29µs) by File::Temp::BEGIN@166 at line 166 of File/Temp.pm
# once (96µs+30µs) by Scalar::Util::BEGIN@10 at line 10 of Scalar/Util.pm
# once (87µs+31µs) by Cwd::BEGIN@172 at line 172 of Cwd.pm
# once (89µs+26µs) by File::Path::BEGIN@19 at line 19 of File/Path.pm
# once (84µs+29µs) by Digest::MD5::BEGIN@4 at line 4 of Digest/MD5.pm
# once (84µs+21µs) by Time::Local::BEGIN@8 at line 8 of Time/Local.pm
# once (73µs+27µs) by Archive::Zip::ZipFileMember::BEGIN@4 at line 4 of Archive/Zip/ZipFileMember.pm
# once (65µs+24µs) by Archive::Zip::Member::BEGIN@6 at line 6 of Archive/Zip/Member.pm
# once (67µs+21µs) by Archive::Zip::NewFileMember::BEGIN@4 at line 4 of Archive/Zip/NewFileMember.pm
# once (60µs+22µs) by Archive::Zip::Archive::BEGIN@13 at line 13 of Archive/Zip/Archive.pm
# once (59µs+18µs) by File::Spec::BEGIN@4 at line 4 of File/Spec.pm
# once (58µs+18µs) by Archive::Zip::StringMember::BEGIN@4 at line 4 of Archive/Zip/StringMember.pm
# once (57µs+17µs) by Archive::Zip::BEGIN@17 at line 17 of Archive/Zip.pm
# once (56µs+16µs) by Archive::Zip::FileMember::BEGIN@4 at line 4 of Archive/Zip/FileMember.pm
# once (54µs+17µs) by Archive::Zip::DirectoryMember::BEGIN@6 at line 6 of Archive/Zip/DirectoryMember.pm
# once (51µs+14µs) by constant::BEGIN@6 at line 6 of constant.pm
# once (51µs+14µs) by File::Spec::Cygwin::BEGIN@4 at line 4 of File/Spec/Cygwin.pm
# once (40µs+22µs) by base::BEGIN@4 at line 4 of base.pm
# once (42µs+18µs) by File::Spec::Unix::BEGIN@4 at line 4 of File/Spec/Unix.pm
# once (41µs+18µs) by Config::BEGIN@11 at line 11 of Config.pm
# once (44µs+10µs) by Archive::Zip::BEGIN@36 at line 36 of Archive/Zip.pm
# once (44µs+10µs) by Archive::Zip::BEGIN@25 at line 25 of Archive/Zip.pm
# once (28µs+7µs) by Digest::base::BEGIN@4 at line 4 of Digest/base.pm | ||||
11 | 27 | 49µs | my $callpack = caller; | ||
12 | 27 | 109µs | my (undef, @imports) = @_; | ||
13 | 27 | 22µs | my ($sym, $ch); | ||
14 | 27 | 243µs | foreach (@imports) { | ||
15 | 82 | 1.15ms | 82 | 465µs | if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) { # spent 465µs making 82 calls to vars::CORE:match, avg 6µs/call |
16 | 82 | 308µs | 82 | 87µs | if ($sym =~ /\W/) { # spent 87µs making 82 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 | 82 | 388µs | 82 | 88µs | $sym = "${callpack}::$sym" unless $sym =~ /::/; # spent 88µs making 82 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 | 82 | 462µs | : 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 | 9µs | 1; | ||
47 | __END__ | ||||
sub vars::CORE:match; # opcode |