line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Package::Pkg::Loader; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
4
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
34
|
|
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
902
|
use Mouse; |
|
1
|
|
|
|
|
35477
|
|
|
1
|
|
|
|
|
5
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
|
429
|
use Package::Pkg; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
10
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
has namespacelist => qw/ is ro required 1 isa ArrayRef /; |
11
|
|
|
|
|
|
|
has alias => qw/ is ro lazy_build 1 isa HashRef /; |
12
|
0
|
|
|
0
|
|
0
|
sub _build_alias { {} } |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub load { |
15
|
3
|
|
|
3
|
0
|
74
|
my $self = shift; |
16
|
3
|
100
|
|
|
|
13
|
my $moniker = @_ > 1 ? Package::Pkg->name( @_ ) : $_[0]; |
17
|
|
|
|
|
|
|
|
18
|
3
|
|
|
|
|
9
|
my $package = $self->softload( $moniker ); |
19
|
3
|
50
|
|
|
|
10
|
unless ( $package ) { |
20
|
0
|
|
|
|
|
0
|
my @namespacelist = @{ $self->namespacelist }; |
|
0
|
|
|
|
|
0
|
|
21
|
0
|
|
|
|
|
0
|
confess "Unable to load package ($moniker) under any namespace (@namespacelist)"; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
|
24
|
3
|
|
|
|
|
18
|
return $package; |
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub softload { |
28
|
3
|
|
|
3
|
0
|
3
|
my $self = shift; |
29
|
3
|
50
|
|
|
|
8
|
my $moniker = @_ > 1 ? Package::Pkg->name( @_ ) : $_[0]; |
30
|
|
|
|
|
|
|
|
31
|
3
|
|
|
|
|
5
|
my @namespacelist = @{ $self->namespacelist }; |
|
3
|
|
|
|
|
12
|
|
32
|
3
|
|
|
|
|
7
|
for my $namespace (@namespacelist) { |
33
|
4
|
100
|
|
|
|
19
|
if ( my $package = Package::Pkg->softload( $namespace, $moniker ) ) { |
34
|
3
|
|
|
|
|
9
|
return $package; |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
0
|
|
|
|
|
|
return; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |