| Filename | /usr/share/perl5/strictures.pm |
| Statements | Executed 123 statements in 1.47ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 12 | 12 | 11 | 160µs | 461µs | strictures::import |
| 10 | 10 | 10 | 146µs | 283µs | strictures::VERSION |
| 1 | 1 | 1 | 16µs | 30µs | strictures::BEGIN@3 |
| 1 | 1 | 1 | 12µs | 12µs | strictures::CORE:ftis (opcode) |
| 1 | 1 | 1 | 10µs | 34µs | strictures::BEGIN@4 |
| 1 | 1 | 1 | 8µs | 22µs | strictures::BEGIN@21 |
| 1 | 1 | 1 | 6µs | 6µs | strictures::BEGIN@6 |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package strictures; | ||||
| 2 | |||||
| 3 | 2 | 50µs | 2 | 44µs | # spent 30µs (16+14) within strictures::BEGIN@3 which was called:
# once (16µs+14µs) by Sub::Quote::BEGIN@3 at line 3 # spent 30µs making 1 call to strictures::BEGIN@3
# spent 14µs making 1 call to strict::import |
| 4 | 2 | 97µs | 2 | 58µs | # spent 34µs (10+24) within strictures::BEGIN@4 which was called:
# once (10µs+24µs) by Sub::Quote::BEGIN@3 at line 4 # spent 34µs making 1 call to strictures::BEGIN@4
# spent 24µs making 1 call to warnings::import |
| 5 | |||||
| 6 | # spent 6µs within strictures::BEGIN@6 which was called:
# once (6µs+0s) by Sub::Quote::BEGIN@3 at line 8 | ||||
| 7 | 1 | 6µs | *_PERL_LT_5_8_4 = ($] < 5.008004) ? sub(){1} : sub(){0}; | ||
| 8 | 1 | 89µs | 1 | 6µs | } # spent 6µs making 1 call to strictures::BEGIN@6 |
| 9 | |||||
| 10 | 1 | 500ns | our $VERSION = '1.005005'; | ||
| 11 | |||||
| 12 | # spent 283µs (146+137) within strictures::VERSION which was called 10 times, avg 28µs/call:
# once (21µs+19µs) by Moo::HandleMoose::_TypeMap::BEGIN@2 at line 2 of Moo/HandleMoose/_TypeMap.pm
# once (20µs+21µs) by Sub::Quote::BEGIN@3 at line 3 of Sub/Quote.pm
# once (20µs+18µs) by Moo::_mro::BEGIN@2 at line 2 of Moo/_mro.pm
# once (20µs+14µs) by Sub::Defer::BEGIN@3 at line 3 of Sub/Defer.pm
# once (16µs+18µs) by Moo::_Utils::BEGIN@11 at line 11 of Moo/_Utils.pm
# once (14µs+12µs) by Method::Generate::Constructor::BEGIN@3 at line 3 of Method/Generate/Constructor.pm
# once (11µs+13µs) by Moo::BEGIN@3 at line 3 of Moo.pm
# once (10µs+8µs) by Moo::sification::BEGIN@3 at line 3 of Moo/sification.pm
# once (8µs+8µs) by Method::Generate::Accessor::BEGIN@3 at line 3 of Method/Generate/Accessor.pm
# once (7µs+7µs) by Moo::Object::BEGIN@3 at line 3 of Moo/Object.pm | ||||
| 13 | 10 | 12µs | my ($class, $version) = @_; | ||
| 14 | 10 | 14µs | for ($version) { | ||
| 15 | 10 | 23µs | last unless defined && !ref && int != 1; | ||
| 16 | die "Major version specified as $_ - this is strictures version 1"; | ||||
| 17 | } | ||||
| 18 | # passing undef here may either warn or die depending on the version of perl. | ||||
| 19 | # we can't match the caller's warning state in this case, so just disable the | ||||
| 20 | # warning. | ||||
| 21 | 2 | 410µs | 2 | 36µs | # spent 22µs (8+14) within strictures::BEGIN@21 which was called:
# once (8µs+14µs) by Sub::Quote::BEGIN@3 at line 21 # spent 22µs making 1 call to strictures::BEGIN@21
# spent 14µs making 1 call to warnings::unimport |
| 22 | 10 | 256µs | 10 | 137µs | shift->SUPER::VERSION(@_); # spent 137µs making 10 calls to version::vxs::_VERSION, avg 14µs/call |
| 23 | } | ||||
| 24 | |||||
| 25 | 1 | 100ns | our $extra_load_states; | ||
| 26 | |||||
| 27 | 1 | 20µs | 1 | 12µs | our $Smells_Like_VCS = (-e '.git' || -e '.svn' || -e '.hg' # spent 12µs making 1 call to strictures::CORE:ftis |
| 28 | || (-e '../../dist.ini' | ||||
| 29 | && (-e '../../.git' || -e '../../.svn' || -e '../../.hg' ))); | ||||
| 30 | |||||
| 31 | # spent 461µs (160+301) within strictures::import which was called 12 times, avg 38µs/call:
# once (22µs+43µs) by Moo::HandleMoose::_TypeMap::BEGIN@2 at line 2 of Moo/HandleMoose/_TypeMap.pm
# once (21µs+42µs) by Moo::_mro::BEGIN@2 at line 2 of Moo/_mro.pm
# once (19µs+40µs) by Moo::_Utils::BEGIN@11 at line 11 of Moo/_Utils.pm
# once (20µs+35µs) by Sub::Defer::BEGIN@3 at line 3 of Sub/Defer.pm
# once (16µs+31µs) by Method::Generate::Constructor::BEGIN@3 at line 3 of Method/Generate/Constructor.pm
# once (11µs+18µs) by Sub::Quote::BEGIN@3 at line 3 of Sub/Quote.pm
# once (11µs+17µs) by Moo::BEGIN@3 at line 3 of Moo.pm
# once (9µs+16µs) by Moo::sification::BEGIN@3 at line 3 of Moo/sification.pm
# once (9µs+16µs) by Method::Generate::Constructor::__ANON__[/usr/share/perl5/Method/Generate/Constructor.pm:202] at line 202 of Method/Generate/Constructor.pm
# once (8µs+15µs) by Method::Generate::Accessor::BEGIN@3 at line 3 of Method/Generate/Accessor.pm
# once (8µs+15µs) by DBIx::Class::Storage::BlockRunner::__ANON__[/usr/share/perl5/DBIx/Class/Storage/BlockRunner.pm:29] at line 29 of DBIx/Class/Storage/BlockRunner.pm
# once (7µs+13µs) by Moo::Object::BEGIN@3 at line 3 of Moo/Object.pm | ||||
| 32 | 12 | 174µs | 12 | 123µs | strict->import; # spent 123µs making 12 calls to strict::import, avg 10µs/call |
| 33 | 12 | 224µs | 12 | 178µs | warnings->import(FATAL => 'all'); # spent 178µs making 12 calls to warnings::import, avg 15µs/call |
| 34 | |||||
| 35 | 12 | 8µs | my $extra_tests = do { | ||
| 36 | 12 | 19µs | if (exists $ENV{PERL_STRICTURES_EXTRA}) { | ||
| 37 | if (_PERL_LT_5_8_4 and $ENV{PERL_STRICTURES_EXTRA}) { | ||||
| 38 | die 'PERL_STRICTURES_EXTRA checks are not available on perls older than 5.8.4: ' | ||||
| 39 | . "please unset \$ENV{PERL_STRICTURES_EXTRA}\n"; | ||||
| 40 | } | ||||
| 41 | 12 | 16µs | $ENV{PERL_STRICTURES_EXTRA}; | ||
| 42 | } elsif (! _PERL_LT_5_8_4) { | ||||
| 43 | !!((caller)[1] =~ /^(?:t|xt|lib|blib)/ | ||||
| 44 | and $Smells_Like_VCS) | ||||
| 45 | } | ||||
| 46 | }; | ||||
| 47 | 12 | 42µs | if ($extra_tests) { | ||
| 48 | $extra_load_states ||= do { | ||||
| 49 | |||||
| 50 | my (%rv, @failed); | ||||
| 51 | foreach my $mod (qw(indirect multidimensional bareword::filehandles)) { | ||||
| 52 | eval "require $mod; \$rv{'$mod'} = 1;" or do { | ||||
| 53 | push @failed, $mod; | ||||
| 54 | |||||
| 55 | # courtesy of the 5.8 require bug | ||||
| 56 | # (we do a copy because 5.16.2 at least uses the same read-only | ||||
| 57 | # scalars for the qw() list and it doesn't seem worth a $^V check) | ||||
| 58 | |||||
| 59 | (my $file = $mod) =~ s|::|/|g; | ||||
| 60 | delete $INC{"${file}.pm"}; | ||||
| 61 | }; | ||||
| 62 | } | ||||
| 63 | |||||
| 64 | if (@failed) { | ||||
| 65 | my $failed = join ' ', @failed; | ||||
| 66 | print STDERR <<EOE; | ||||
| 67 | strictures.pm extra testing active but couldn't load all modules. Missing were: | ||||
| 68 | |||||
| 69 | $failed | ||||
| 70 | |||||
| 71 | Extra testing is auto-enabled in checkouts only, so if you're the author | ||||
| 72 | of a strictures-using module you need to run: | ||||
| 73 | |||||
| 74 | cpan indirect multidimensional bareword::filehandles | ||||
| 75 | |||||
| 76 | but these modules are not required by your users. | ||||
| 77 | EOE | ||||
| 78 | } | ||||
| 79 | |||||
| 80 | \%rv; | ||||
| 81 | }; | ||||
| 82 | |||||
| 83 | indirect->unimport(':fatal') if $extra_load_states->{indirect}; | ||||
| 84 | multidimensional->unimport if $extra_load_states->{multidimensional}; | ||||
| 85 | bareword::filehandles->unimport if $extra_load_states->{'bareword::filehandles'}; | ||||
| 86 | } | ||||
| 87 | } | ||||
| 88 | |||||
| 89 | 1 | 5µs | 1; | ||
| 90 | |||||
| 91 | __END__ | ||||
# spent 12µs within strictures::CORE:ftis which was called:
# once (12µs+0s) by Sub::Quote::BEGIN@3 at line 27 |