blib/lib/perl5i/2/RequireMessage.pm

filter: Statementstmt 100% 21 / 21 Branchbran 100% 4 / 4 Conditioncond 83.3% 5 / 6 MC/DCmcdc 75.0% 3 / 4 Subroutinesub 100% 4 / 4 Podpod n/a totaltotal 94.8% 37 / 39 SCAR 16.1
CC
5
Cov
97%
__ANON__
4.0
__ANON__
2.0
BEGIN
1.0
CRAP 5.0
« blib/lib/perl5i.pm ↑ Summary blib/lib/perl5i/1/UNIVERSAL.pm »
1 package perl5i::2::RequireMessage;
2 109 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 109 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 # This is the sub that displays the message
6 my $diesub = sub {
7 415 ▶ my ( $sub, $mod ) = @_;
Subroutine __ANON__: called CC=2 SCAR=6.9
8  
9 415 my $hints = (caller(0))[10];
10 415 ▶ return unless $hints->{perl5i};
Branch: 1 branch
BranchTrueFalseTotal
unless $hints->{"perl5i"} 413 2 415
11 2 die( <<EOT );
12 Can't locate $mod in your Perl library. You may need to install it
13 from CPAN or another repository. Your library paths are:
14 2 @{[ map { " $_\n" } grep { !ref($_) } @INC ]}
15 EOT
16 109 };
17  
18 # This sub makes sure the die sub is always at the end of @INC.
19 push @INC => sub {
20 415 ▶ return if ref($INC[-1]) && $INC[-1] == $diesub;
Subroutine __ANON__: called CC=4 SCAR=13.9
Branch: 1 branch
BranchTrueFalseTotal
if ref $INC[-1] and $INC[-1] == $diesub 414 1 415
Condition66%2/3
ref $INC[-1] and $INC[-1] == $diesub
!ll&&!rl&&r
10414
MC/DC50%1/2
ref $INC[-1] and $INC[-1] == $diesub
ref $INC[-1] $INC[-1] == $diesub
Truth table66%2/3
A and B
A= ref $INC[-1]B= $INC[-1] == $diesub
ABresult
0X0
100
111
21 1 ▶ @INC = grep { !(ref($_) && $_ == $diesub) } @INC;
Condition100%3/3
ref $_ && $_ == $diesub
!ll&&!rl&&r
1111
MC/DC100%2/2
ref $_ && $_ == $diesub
ref $_ $_ == $diesub
Truth table100%3/3
A && B
A= ref $_B= $_ == $diesub
ABresult
0X0
100
111
22 1 push @INC => $diesub;
23 109 };
24 109 push @INC => $diesub;
25  
26 109 1;
« blib/lib/perl5i.pm ↑ Summary blib/lib/perl5i/1/UNIVERSAL.pm »