Filename | /usr/local/perls/perl-5.26.1/lib/5.26.1/strict.pm |
Statements | Executed 185 statements in 818µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
41 | 41 | 40 | 209µs | 209µs | import | strict::
10 | 10 | 10 | 119µs | 233µs | unimport | strict::
9 | 1 | 1 | 114µs | 114µs | bits | strict::
0 | 0 | 0 | 0s | 0s | BEGIN | strict::
0 | 0 | 0 | 0s | 0s | __ANON__[:31] | strict::
0 | 0 | 0 | 0s | 0s | __ANON__[:37] | strict::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package strict; | ||||
2 | |||||
3 | $strict::VERSION = "1.11"; | ||||
4 | |||||
5 | my ( %bitmask, %explicit_bitmask ); | ||||
6 | |||||
7 | BEGIN { | ||||
8 | # Verify that we're called correctly so that strictures will work. | ||||
9 | # Can't use Carp, since Carp uses us! | ||||
10 | # see also warnings.pm. | ||||
11 | die sprintf "Incorrect use of pragma '%s' at %s line %d.\n", __PACKAGE__, +(caller)[1,2] | ||||
12 | if __FILE__ !~ ( '(?x) \b '.__PACKAGE__.' \.pmc? \z' ) | ||||
13 | && __FILE__ =~ ( '(?x) \b (?i:'.__PACKAGE__.') \.pmc? \z' ); | ||||
14 | |||||
15 | %bitmask = ( | ||||
16 | refs => 0x00000002, | ||||
17 | subs => 0x00000200, | ||||
18 | vars => 0x00000400, | ||||
19 | ); | ||||
20 | |||||
21 | %explicit_bitmask = ( | ||||
22 | refs => 0x00000020, | ||||
23 | subs => 0x00000040, | ||||
24 | vars => 0x00000080, | ||||
25 | ); | ||||
26 | |||||
27 | my $bits = 0; | ||||
28 | $bits |= $_ for values %bitmask; | ||||
29 | |||||
30 | my $inline_all_bits = $bits; | ||||
31 | *all_bits = sub () { $inline_all_bits }; | ||||
32 | |||||
33 | $bits = 0; | ||||
34 | $bits |= $_ for values %explicit_bitmask; | ||||
35 | |||||
36 | my $inline_all_explicit_bits = $bits; | ||||
37 | *all_explicit_bits = sub () { $inline_all_explicit_bits }; | ||||
38 | } | ||||
39 | |||||
40 | # spent 114µs within strict::bits which was called 9 times, avg 13µs/call:
# 9 times (114µs+0s) by strict::unimport at line 69, avg 13µs/call | ||||
41 | 9 | 10µs | my $bits = 0; | ||
42 | 9 | 8µs | my @wrong; | ||
43 | 9 | 16µs | foreach my $s (@_) { | ||
44 | 9 | 21µs | if (exists $bitmask{$s}) { | ||
45 | 9 | 25µs | $^H |= $explicit_bitmask{$s}; | ||
46 | |||||
47 | 9 | 5µs | $bits |= $bitmask{$s}; | ||
48 | } | ||||
49 | else { | ||||
50 | push @wrong, $s; | ||||
51 | } | ||||
52 | } | ||||
53 | 9 | 6µs | if (@wrong) { | ||
54 | require Carp; | ||||
55 | Carp::croak("Unknown 'strict' tag(s) '@wrong'"); | ||||
56 | } | ||||
57 | 9 | 69µs | $bits; | ||
58 | } | ||||
59 | |||||
60 | # spent 209µs within strict::import which was called 41 times, avg 5µs/call:
# once (18µs+0s) by CPAN::BEGIN@201 at line 201 of Term/ReadLine.pm
# once (11µs+0s) by Time::HiRes::BEGIN@4 at line 4 of Time/HiRes.pm
# once (10µs+0s) by URI::file::Unix::BEGIN@3 at line 3 of URI/file/Unix.pm
# once (9µs+0s) by IO::Zlib::BEGIN@288 at line 288 of IO/Zlib.pm
# once (7µs+0s) by IO::Compress::Bzip2::BEGIN@3 at line 3 of IO/Compress/Bzip2.pm
# once (7µs+0s) by URI::URL::BEGIN@3 at line 3 of URI/URL.pm
# once (7µs+0s) by Tie::StdHandle::BEGIN@3 at line 3 of Tie/StdHandle.pm
# once (6µs+0s) by parent::BEGIN@2 at line 2 of parent.pm
# once (6µs+0s) by IO::Compress::Gzip::Constants::BEGIN@3 at line 3 of IO/Compress/Gzip/Constants.pm
# once (6µs+0s) by URI::file::BEGIN@3 at line 3 of URI/file.pm
# once (6µs+0s) by Digest::base::BEGIN@3 at line 3 of Digest/base.pm
# once (5µs+0s) by IO::Compress::Base::Common::BEGIN@3 at line 3 of IO/Compress/Base/Common.pm
# once (5µs+0s) by URI::_query::BEGIN@3 at line 3 of URI/_query.pm
# once (5µs+0s) by Digest::SHA::BEGIN@5 at line 5 of Digest/SHA.pm
# once (5µs+0s) by URI::_generic::BEGIN@3 at line 3 of URI/_generic.pm
# once (5µs+0s) by IO::Uncompress::Adapter::Inflate::BEGIN@3 at line 3 of IO/Uncompress/Adapter/Inflate.pm
# once (5µs+0s) by Archive::Tar::BEGIN@23 at line 23 of Archive/Tar.pm
# once (5µs+0s) by IO::Uncompress::Bunzip2::BEGIN@3 at line 3 of IO/Uncompress/Bunzip2.pm
# once (5µs+0s) by Archive::Tar::File::BEGIN@2 at line 2 of Archive/Tar/File.pm
# once (4µs+0s) by IO::Uncompress::Adapter::Bunzip2::BEGIN@3 at line 3 of IO/Uncompress/Adapter/Bunzip2.pm
# once (4µs+0s) by URI::BEGIN@3 at line 3 of URI.pm
# once (4µs+0s) by URI::Escape::BEGIN@3 at line 3 of URI/Escape.pm
# once (4µs+0s) by IO::Compress::Gzip::BEGIN@5 at line 5 of IO/Compress/Gzip.pm
# once (4µs+0s) by Compress::Raw::Zlib::BEGIN@8 at line 8 of Compress/Raw/Zlib.pm
# once (4µs+0s) by Compress::Raw::Bzip2::BEGIN@4 at line 4 of Compress/Raw/Bzip2.pm
# once (4µs+0s) by Term::Cap::BEGIN@17 at line 17 of Term/Cap.pm
# once (4µs+0s) by IO::Compress::Zlib::Extra::BEGIN@5 at line 5 of IO/Compress/Zlib/Extra.pm
# once (4µs+0s) by URI::file::Base::BEGIN@3 at line 3 of URI/file/Base.pm
# once (4µs+0s) by File::Glob::BEGIN@3 at line 3 of File/Glob.pm
# once (4µs+0s) by URI::WithBase::BEGIN@3 at line 3 of URI/WithBase.pm
# once (3µs+0s) by Compress::Zlib::BEGIN@15 at line 15 of Compress/Zlib.pm
# once (3µs+0s) by IO::Compress::Base::Common::BEGIN@520 at line 520 of IO/Compress/Base/Common.pm
# once (3µs+0s) by Archive::Tar::Constant::BEGIN@14 at line 14 of Archive/Tar/Constant.pm
# once (3µs+0s) by IO::Uncompress::RawInflate::BEGIN@4 at line 4 of IO/Uncompress/RawInflate.pm
# once (3µs+0s) by IO::Uncompress::Gunzip::BEGIN@8 at line 8 of IO/Uncompress/Gunzip.pm
# once (3µs+0s) by File::GlobMapper::BEGIN@3 at line 3 of File/GlobMapper.pm
# once (3µs+0s) by IO::Compress::Adapter::Bzip2::BEGIN@3 at line 3 of IO/Compress/Adapter/Bzip2.pm
# once (3µs+0s) by IO::Compress::Base::BEGIN@6 at line 6 of IO/Compress/Base.pm
# once (3µs+0s) by IO::Compress::Adapter::Deflate::BEGIN@3 at line 3 of IO/Compress/Adapter/Deflate.pm
# once (3µs+0s) by IO::Compress::RawDeflate::BEGIN@5 at line 5 of IO/Compress/RawDeflate.pm
# once (2µs+0s) by IO::Uncompress::Base::BEGIN@4 at line 4 of IO/Uncompress/Base.pm | ||||
61 | 41 | 12µs | shift; | ||
62 | 41 | 521µs | $^H |= @_ ? &bits : all_bits | all_explicit_bits; | ||
63 | } | ||||
64 | |||||
65 | # spent 233µs (119+114) within strict::unimport which was called 10 times, avg 23µs/call:
# once (21µs+19µs) by URI::BEGIN@130 at line 130 of URI.pm
# once (19µs+13µs) by Time::HiRes::BEGIN@48 at line 48 of Time/HiRes.pm
# once (13µs+16µs) by Archive::Tar::File::BEGIN@47 at line 47 of Archive/Tar/File.pm
# once (12µs+15µs) by URI::file::BEGIN@31 at line 31 of URI/file.pm
# once (14µs+11µs) by Archive::Tar::BEGIN@111 at line 111 of Archive/Tar.pm
# once (14µs+10µs) by Compress::Raw::Bzip2::BEGIN@49 at line 49 of Compress/Raw/Bzip2.pm
# once (8µs+12µs) by parent::BEGIN@21 at line 21 of parent.pm
# once (7µs+10µs) by Compress::Raw::Zlib::BEGIN@113 at line 113 of Compress/Raw/Zlib.pm
# once (7µs+8µs) by Archive::Tar::Constant::BEGIN@94 at line 94 of Archive/Tar/Constant.pm
# once (4µs+0s) by File::Glob::BEGIN@58 at line 58 of File/Glob.pm | ||||
66 | 10 | 3µs | shift; | ||
67 | |||||
68 | 10 | 88µs | if (@_) { | ||
69 | 9 | 33µs | 9 | 114µs | $^H &= ~&bits; # spent 114µs making 9 calls to strict::bits, avg 13µs/call |
70 | } | ||||
71 | else { | ||||
72 | 1 | 1µs | $^H &= ~all_bits; | ||
73 | 1 | 0s | $^H |= all_explicit_bits; | ||
74 | } | ||||
75 | } | ||||
76 | |||||
77 | 1; | ||||
78 | __END__ |