line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package perl5i::2::RequireMessage; |
2
|
103
|
|
|
103
|
|
662
|
use strict; |
|
103
|
|
|
|
|
202
|
|
|
103
|
|
|
|
|
3837
|
|
3
|
103
|
|
|
103
|
|
851
|
use warnings; |
|
103
|
|
|
|
|
186
|
|
|
103
|
|
|
|
|
31337
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
# This is the sub that displays the message |
6
|
|
|
|
|
|
|
my $diesub = sub { |
7
|
|
|
|
|
|
|
my ( $sub, $mod ) = @_; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
my $hints = (caller(0))[10]; |
10
|
|
|
|
|
|
|
return unless $hints->{perl5i}; |
11
|
|
|
|
|
|
|
die( <
|
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
|
|
|
|
|
|
|
@{[ map { " $_\n" } grep { !ref($_) } @INC ]} |
15
|
|
|
|
|
|
|
EOT |
16
|
|
|
|
|
|
|
}; |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# This sub makes sure the die sub is always at the end of @INC. |
19
|
|
|
|
|
|
|
push @INC => sub { |
20
|
|
|
|
|
|
|
return if ref($INC[-1]) && $INC[-1] == $diesub; |
21
|
|
|
|
|
|
|
@INC = grep { !(ref($_) && $_ == $diesub) } @INC; |
22
|
|
|
|
|
|
|
push @INC => $diesub; |
23
|
|
|
|
|
|
|
}; |
24
|
|
|
|
|
|
|
push @INC => $diesub; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |