| 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
| |||||||||||||||||||||||||||||
| 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
Condition66%2/3
ref $INC[-1] and $INC[-1] == $diesub
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
| |||||||||||||||||||||||||||||
| 21 | 1 | ▶ | @INC = grep { !(ref($_) && $_ == $diesub) } @INC; | ||||||||||||||||||||||||||
|
Condition100%3/3
ref $_ && $_ == $diesub
MC/DC100%2/2
ref $_ && $_ == $diesub
ref $_
$_ == $diesub
Truth table100%3/3
A && B
A= ref $_B= $_ == $diesub
| |||||||||||||||||||||||||||||
| 22 | 1 | push @INC => $diesub; | |||||||||||||||||||||||||||
| 23 | 109 | }; | |||||||||||||||||||||||||||
| 24 | 109 | push @INC => $diesub; | |||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 109 | 1; | |||||||||||||||||||||||||||