File | /usr/share/perl/5.10/vars.pm |
Statements Executed | 615 |
Total Time | 0.0024308 seconds |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
44 | 44 | 31 | 1.97ms | 1.97ms | import | vars::
0 | 0 | 0 | 0s | 0s | BEGIN | vars::
Line | Stmts. | Exclusive Time | Avg. | Code |
---|---|---|---|---|
1 | package vars; | |||
2 | ||||
3 | 3 | 70µs | 23µs | use 5.006; |
4 | ||||
5 | 1 | 700ns | 700ns | our $VERSION = '1.01'; |
6 | ||||
7 | 3 | 314µs | 105µs | use warnings::register; # spent 110µs making 1 call to warnings::register::import |
8 | 3 | 362µs | 121µs | use strict qw(vars subs); # spent 27µs making 1 call to strict::import |
9 | ||||
10 | # spent 1.97ms within vars::import which was called 44 times, avg 45µs/call:
# once (152µs+0s) at line 6 of /usr/lib/perl5/XML/LibXML.pm
# once (90µs+0s) at line 4 of /usr/lib/perl/5.10/Time/HiRes.pm
# once (83µs+0s) by POSIX::SigRt::BEGIN at line 75 of /usr/lib/perl/5.10/POSIX.pm
# once (77µs+0s) at line 51 of /usr/share/perl5/XML/Simple.pm
# once (74µs+0s) at line 13 of /usr/lib/perl5/XML/LibXML/Common.pm
# once (73µs+0s) by List::Util::BEGIN at line 12 of /usr/lib/perl/5.10/List/Util.pm
# once (70µs+0s) at line 6 of /usr/local/share/perl/5.10.0/Try/Tiny.pm
# once (66µs+0s) by List::MoreUtils::BEGIN at line 8 of /usr/lib/perl5/List/MoreUtils.pm
# once (62µs+0s) at line 6 of /usr/lib/perl5/XML/LibXML/XPathContext.pm
# once (60µs+0s) at line 12 of /usr/local/share/perl/5.10.0/namespace/clean.pm
# once (59µs+0s) at line 6 of /usr/share/perl5/XML/SAX.pm
# once (58µs+0s) by Params::Util::BEGIN at line 65 of /usr/local/lib/perl/5.10.0/Params/Util.pm
# once (58µs+0s) by Scalar::Util::BEGIN at line 10 of /usr/lib/perl/5.10/Scalar/Util.pm
# once (57µs+0s) at line 27 of /usr/share/perl5/MARC/Record.pm
# once (56µs+0s) at line 24 of /usr/local/lib/perl/5.10.0/Storable.pm
# once (54µs+0s) by XML::LibXML::InputCallback::BEGIN at line 1624 of /usr/lib/perl5/XML/LibXML.pm
# once (47µs+0s) at line 5 of /usr/share/perl5/MARC/File/XML.pm
# once (44µs+0s) at line 6 of /usr/lib/perl5/XML/LibXML/SAX/Parser.pm
# once (40µs+0s) at line 8 of /usr/local/lib/perl/5.10.0/Devel/GlobalDestruction.pm
# once (37µs+0s) at line 8 of /usr/share/perl5/XML/SAX/Exception.pm
# once (37µs+0s) by XML::LibXML::Document::BEGIN at line 984 of /usr/lib/perl5/XML/LibXML.pm
# once (35µs+0s) at line 6 of /usr/share/perl/5.10/constant.pm
# once (33µs+0s) by File::Spec::BEGIN at line 4 of /usr/lib/perl5/File/Spec.pm
# once (32µs+0s) by XML::LibXML::Dtd::BEGIN at line 1377 of /usr/lib/perl5/XML/LibXML.pm
# once (31µs+0s) at line 8 of /usr/lib/perl5/XML/LibXML/Literal.pm
# once (30µs+0s) at line 29 of /usr/share/perl5/XML/SAX/Base.pm
# once (29µs+0s) by base::BEGIN at line 4 of /usr/share/perl/5.10/base.pm
# once (29µs+0s) at line 9 of /usr/lib/perl5/XML/LibXML/NodeList.pm
# once (28µs+0s) at line 1103 of /usr/lib/perl5/XML/LibXML.pm
# once (28µs+0s) at line 23 of /usr/share/perl5/MARC/Record.pm
# once (28µs+0s) at line 9 of /usr/lib/perl5/XML/LibXML/Boolean.pm
# once (27µs+0s) by XML::LibXML::Text::BEGIN at line 1286 of /usr/lib/perl5/XML/LibXML.pm
# once (27µs+0s) by XML::LibXML::Comment::BEGIN at line 1339 of /usr/lib/perl5/XML/LibXML.pm
# once (26µs+0s) by XML::LibXML::PI::BEGIN at line 1386 of /usr/lib/perl5/XML/LibXML.pm
# once (26µs+0s) at line 32 of /usr/share/perl5/MARC/Record.pm
# once (26µs+0s) at line 8 of /usr/lib/perl5/XML/LibXML/Number.pm
# once (25µs+0s) at line 6 of /usr/share/perl5/XML/SAX/ParserFactory.pm
# once (25µs+0s) by MARC::Field::BEGIN at line 10 of /usr/share/perl5/MARC/Field.pm
# once (24µs+0s) at line 12 of /usr/share/perl5/MARC/Record.pm
# once (24µs+0s) at line 12 of /usr/share/perl5/MARC/File.pm
# once (22µs+0s) by XML::LibXML::DocumentFragment::BEGIN at line 1080 of /usr/lib/perl5/XML/LibXML.pm
# once (22µs+0s) by XML::LibXML::Attr::BEGIN at line 1355 of /usr/lib/perl5/XML/LibXML.pm
# once (20µs+0s) at line 4 of /usr/lib/perl5/File/Spec/Unix.pm
# once (19µs+0s) by XML::LibXML::CDATASection::BEGIN at line 1346 of /usr/lib/perl5/XML/LibXML.pm | |||
11 | 604 | 1.68ms | 3µs | my $callpack = caller; |
12 | my ($pack, @imports) = @_; | |||
13 | my ($sym, $ch); | |||
14 | foreach (@imports) { | |||
15 | if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) { | |||
16 | if ($sym =~ /\W/) { | |||
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 | $sym = "${callpack}::$sym" unless $sym =~ /::/; | |||
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 | 3µs | 1; |
47 | __END__ | |||
48 |