line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Net::OpenSSH::ModuleLoader; |
2
|
|
|
|
|
|
|
|
3
|
7
|
|
|
7
|
|
42
|
use strict; |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
172
|
|
4
|
7
|
|
|
7
|
|
28
|
use warnings; |
|
7
|
|
|
|
|
10
|
|
|
7
|
|
|
|
|
129
|
|
5
|
7
|
|
|
7
|
|
29
|
use Carp; |
|
7
|
|
|
|
|
10
|
|
|
7
|
|
|
|
|
447
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our %loaded_module; |
8
|
|
|
|
|
|
|
|
9
|
7
|
|
|
7
|
|
68
|
use Exporter qw(import); |
|
7
|
|
|
|
|
12
|
|
|
7
|
|
|
|
|
1785
|
|
10
|
|
|
|
|
|
|
our @EXPORT = qw(_load_module); |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub _load_module { |
13
|
6
|
|
|
6
|
|
75
|
my ($module, $version) = @_; |
14
|
6
|
|
66
|
|
|
64
|
$loaded_module{$module} ||= do { |
15
|
4
|
|
|
|
|
9
|
my $err; |
16
|
4
|
50
|
|
|
|
19
|
do { |
17
|
4
|
|
|
|
|
41
|
local ($@, $SIG{__DIE__}); |
18
|
4
|
|
|
|
|
356
|
my $ok = eval "require $module; 1"; |
19
|
4
|
|
|
|
|
12
|
$err = $@; |
20
|
4
|
|
|
|
|
33
|
$ok; |
21
|
|
|
|
|
|
|
} or croak "unable to load Perl module $module: $err"; |
22
|
|
|
|
|
|
|
}; |
23
|
6
|
50
|
|
|
|
32
|
if (defined $version) { |
24
|
0
|
|
0
|
|
|
0
|
my $mv = do { |
25
|
|
|
|
|
|
|
local ($@, $SIG{__DIE__}); |
26
|
|
|
|
|
|
|
eval "\$${module}::VERSION"; |
27
|
|
|
|
|
|
|
} || 0; |
28
|
0
|
|
|
|
|
0
|
(my $mv1 = $mv) =~ s/_\d*$//; |
29
|
0
|
0
|
|
|
|
0
|
croak "$module version $version required, $mv is available" |
30
|
|
|
|
|
|
|
if $mv1 < $version; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
1 |
33
|
6
|
|
|
|
|
18
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |