Filename | /usr/share/perl/5.14/vars.pm |
Statements | Executed 992 statements in 3.01ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
62 | 62 | 55 | 1.89ms | 2.36ms | import | vars::
552 | 3 | 1 | 465µs | 465µs | CORE:match (opcode) | vars::
1 | 1 | 1 | 174µs | 241µs | BEGIN@7 | vars::
1 | 1 | 1 | 44µs | 44µs | BEGIN@3 | vars::
1 | 1 | 1 | 5µs | 16µs | BEGIN@8 | vars::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package vars; | ||||
2 | |||||
3 | 2 | 68µs | 1 | 44µs | # spent 44µs within vars::BEGIN@3 which was called:
# once (44µs+0s) by Time::HiRes::BEGIN@4 at line 3 # spent 44µs making 1 call to vars::BEGIN@3 |
4 | |||||
5 | 1 | 800ns | our $VERSION = '1.02'; | ||
6 | |||||
7 | 2 | 192µs | 2 | 308µs | # spent 241µs (174+67) within vars::BEGIN@7 which was called:
# once (174µs+67µs) by Time::HiRes::BEGIN@4 at line 7 # spent 241µs making 1 call to vars::BEGIN@7
# spent 66µs making 1 call to warnings::register::import |
8 | 2 | 276µs | 2 | 26µs | # spent 16µs (5+11) within vars::BEGIN@8 which was called:
# once (5µs+11µs) by Time::HiRes::BEGIN@4 at line 8 # spent 16µs making 1 call to vars::BEGIN@8
# spent 10µs making 1 call to strict::import |
9 | |||||
10 | # spent 2.36ms (1.89+465µs) within vars::import which was called 62 times, avg 38µs/call:
# once (92µs+22µs) by Mail::Sendmail::BEGIN@39 at line 39 of Mail/Sendmail.pm
# once (72µs+18µs) by Math::BigInt::BEGIN@28 at line 28 of Math/BigInt.pm
# once (72µs+17µs) by Value::Convertor::BEGIN@154 at line 154 of Value/Convertor.pm
# once (63µs+14µs) by Time::HiRes::BEGIN@4 at line 4 of Time/HiRes.pm
# once (59µs+11µs) by DateTime::TimeZone::OlsonDB::BEGIN@12 at line 12 of DateTime/TimeZone/OlsonDB.pm
# once (46µs+12µs) by DateTime::TimeZone::Catalog::BEGIN@18 at line 18 of DateTime/TimeZone/Catalog.pm
# once (46µs+11µs) by POSIX::SigRt::BEGIN@60 at line 60 of POSIX.pm
# once (49µs+7µs) by Storable::BEGIN@22 at line 22 of Storable.pm
# once (43µs+11µs) by Sys::Hostname::Long::BEGIN@12 at line 12 of Sys/Hostname/Long.pm
# once (42µs+11µs) by Clone::BEGIN@6 at line 6 of Clone.pm
# once (37µs+16µs) by Time::Local::BEGIN@8 at line 8 of Time/Local.pm
# once (40µs+10µs) by Time::Zone::BEGIN@47 at line 47 of Time/Zone.pm
# once (40µs+9µs) by Readonly::BEGIN@171 at line 171 of Readonly.pm
# once (39µs+10µs) by List::MoreUtils::BEGIN@8 at line 8 of List/MoreUtils.pm
# once (39µs+9µs) by Log::Writer::Syslog::BEGIN@83 at line 83 of Log/Writer/Syslog.pm
# once (38µs+9µs) by Time::Zone::BEGIN@149 at line 148 of Time/Zone.pm
# once (36µs+9µs) by Params::Util::BEGIN@65 at line 65 of Params/Util.pm
# once (36µs+9µs) by Date::Parse::BEGIN@207 at line 207 of Date/Parse.pm
# once (35µs+9µs) by Cwd::BEGIN@5 at line 5 of Cwd.pm
# once (35µs+8µs) by MIME::Base64::BEGIN@4 at line 4 of MIME/Base64.pm
# once (32µs+8µs) by Log::Writer::Handle::BEGIN@125 at line 125 of Log/Writer/Handle.pm
# once (30µs+7µs) by Log::Writer::Email::BEGIN@83 at line 83 of Log/Writer/Email.pm
# once (29µs+8µs) by Digest::MD5::BEGIN@4 at line 4 of Digest/MD5.pm
# once (31µs+7µs) by Mentat::Storage::Mongo::BEGIN@195 at line 195 of Mentat/Storage/Mongo.pm
# once (29µs+8µs) by Date::Parse::BEGIN@9 at line 9 of Date/Parse.pm
# once (30µs+8µs) by MIME::QuotedPrint::BEGIN@4 at line 4 of MIME/QuotedPrint.pm
# once (29µs+8µs) by Params::Validate::BEGIN@15 at line 15 of Params/Validate.pm
# once (29µs+7µs) by Log::Writer::File::BEGIN@78 at line 78 of Log/Writer/File.pm
# once (29µs+7µs) by Log::Writer::Std::BEGIN@76 at line 76 of Log/Writer/Std.pm
# once (28µs+8µs) by Readonly::XS::BEGIN@20 at line 20 of Readonly/XS.pm
# once (29µs+7µs) by Readonly::BEGIN@35 at line 35 of Readonly.pm
# once (27µs+8µs) by bigint::BEGIN@18 at line 18 of bigint.pm
# once (28µs+6µs) by Mentat::Storage::BEGIN@82 at line 82 of Mentat/Storage.pm
# once (28µs+6µs) by File::Spec::BEGIN@4 at line 4 of File/Spec.pm
# once (28µs+6µs) by Log::Filter::Re::BEGIN@90 at line 90 of Log/Filter/Re.pm
# once (26µs+6µs) by Log::Filter::Source::BEGIN@79 at line 79 of Log/Filter/Source.pm
# once (25µs+6µs) by Log::Filter::Message::BEGIN@80 at line 80 of Log/Filter/Message.pm
# once (25µs+6µs) by Readonly::BEGIN@32 at line 32 of Readonly.pm
# once (25µs+6µs) by Log::Core::Essentials::BEGIN@79 at line 79 of Log/Core/Essentials.pm
# once (24µs+6µs) by Log::Filter::All::BEGIN@75 at line 75 of Log/Filter/All.pm
# once (23µs+5µs) by Log::Channel::Channel::BEGIN@78 at line 78 of Log/Channel/Channel.pm
# once (22µs+6µs) by Log::Writer::Module::BEGIN@73 at line 73 of Log/Writer/Module.pm
# once (22µs+6µs) by Log::Filter::Severity::BEGIN@79 at line 79 of Log/Filter/Severity.pm
# once (22µs+5µs) by Log::Filter::None::BEGIN@75 at line 75 of Log/Filter/None.pm
# once (22µs+5µs) by Log::Filter::Set::BEGIN@88 at line 88 of Log/Filter/Set.pm
# once (21µs+6µs) by Log::Filter::Threshold::BEGIN@91 at line 91 of Log/Filter/Threshold.pm
# once (21µs+6µs) by Tie::IxHash::BEGIN@15 at line 15 of Tie/IxHash.pm
# once (20µs+5µs) by constant::BEGIN@6 at line 6 of constant.pm
# once (16µs+4µs) by Log::Loger::BEGIN@140 at line 140 of Log/Loger.pm
# once (16µs+4µs) by Mail::Sendmail::BEGIN@183 at line 183 of Mail/Sendmail.pm
# once (14µs+4µs) by Config::BEGIN@11 at line 11 of Config.pm
# once (15µs+4µs) by Sys::Syslog::BEGIN@78 at line 78 of Sys/Syslog.pm
# once (14µs+4µs) by Net::CIDR::Lite::BEGIN@4 at line 4 of Net/CIDR/Lite.pm
# once (14µs+3µs) by Log::Channel::Module::BEGIN@79 at line 79 of Log/Channel/Module.pm
# once (14µs+4µs) by Log::Filter::Module::BEGIN@81 at line 81 of Log/Filter/Module.pm
# once (14µs+4µs) by parent::BEGIN@3 at line 3 of parent.pm
# once (13µs+4µs) by base::BEGIN@4 at line 4 of base.pm
# once (13µs+4µs) by File::Spec::Unix::BEGIN@4 at line 4 of File/Spec/Unix.pm
# once (13µs+4µs) by Digest::base::BEGIN@4 at line 4 of Digest/base.pm
# once (13µs+3µs) by Mutex::Flock::BEGIN@80 at line 80 of Mutex/Flock.pm
# once (13µs+3µs) by Time::Zone::BEGIN@59 at line 59 of Time/Zone.pm
# once (12µs+3µs) by Sys::Syslog::BEGIN@88 at line 88 of Sys/Syslog.pm | ||||
11 | 248 | 380µs | my $callpack = caller; | ||
12 | my (undef, @imports) = @_; | ||||
13 | my ($sym, $ch); | ||||
14 | foreach (@imports) { | ||||
15 | 736 | 2.09ms | 184 | 319µs | if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) { # spent 319µs making 184 calls to vars::CORE:match, avg 2µs/call |
16 | 184 | 81µs | if ($sym =~ /\W/) { # spent 81µs making 184 calls to vars::CORE:match, avg 440ns/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 | 184 | 65µs | $sym = "${callpack}::$sym" unless $sym =~ /::/; # spent 65µs making 184 calls to vars::CORE:match, avg 354ns/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 |