line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Exodist::Util::Loader; |
2
|
2
|
|
|
2
|
|
29414
|
use strict; |
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
74
|
|
3
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
54
|
|
4
|
|
|
|
|
|
|
|
5
|
2
|
|
|
2
|
|
952
|
use Exporter::Declare; |
|
2
|
|
|
|
|
26011
|
|
|
2
|
|
|
|
|
36
|
|
6
|
2
|
|
|
2
|
|
3409
|
use Carp qw/croak/; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
566
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
default_exports qw/ load_package /; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub load_package { |
11
|
3
|
|
|
3
|
1
|
1242
|
my ($name, $namespace) = @_; |
12
|
|
|
|
|
|
|
|
13
|
3
|
|
|
|
|
8
|
my @options = ( $name ); |
14
|
3
|
50
|
|
|
|
15
|
push @options => "$namespace\::$name" if $namespace; |
15
|
|
|
|
|
|
|
|
16
|
3
|
50
|
|
|
|
15
|
@options = reverse @options |
17
|
|
|
|
|
|
|
if $name =~ m/::/; |
18
|
|
|
|
|
|
|
|
19
|
3
|
|
|
|
|
6
|
for my $pkg ( @options ) { |
20
|
5
|
100
|
|
|
|
349
|
return $pkg if eval "require $pkg; 1"; |
21
|
3
|
|
|
|
|
13
|
my $file = $pkg; |
22
|
3
|
|
|
|
|
9
|
$file =~ s|::|/|g; |
23
|
3
|
50
|
|
|
|
72
|
croak( $@ ) unless $@ =~ m{Can't locate /?$file\.pm in \@INC}; |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
1
|
|
|
|
|
31
|
croak( "Could not find $name as " . join( ' or ', @options )); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__END__ |