line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Object::Remote::FromData; |
2
|
|
|
|
|
|
|
|
3
|
4
|
|
|
4
|
|
119709
|
use strictures 1; |
|
4
|
|
|
|
|
41
|
|
|
4
|
|
|
|
|
143
|
|
4
|
4
|
|
|
4
|
|
1066
|
use Object::Remote; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
95
|
|
5
|
4
|
|
|
4
|
|
21
|
use Object::Remote::Logging qw ( :log ); |
|
4
|
|
|
|
|
7
|
|
|
4
|
|
|
|
|
18
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our %Modules; |
8
|
|
|
|
|
|
|
our %Not_Loaded_Yet; |
9
|
|
|
|
|
|
|
our %Seen; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub import { |
12
|
4
|
|
|
4
|
|
35
|
my $target = caller; |
13
|
4
|
|
|
0
|
|
26
|
log_trace { "import has been invoked by '$target' on " . __PACKAGE__ }; |
|
0
|
|
|
|
|
0
|
|
14
|
4
|
50
|
|
|
|
52
|
return if $Seen{$target}; |
15
|
4
|
|
|
0
|
|
22
|
log_debug { "'$target' has not yet loaded " . __PACKAGE__ }; |
|
0
|
|
|
|
|
0
|
|
16
|
4
|
|
|
|
|
6502
|
$Seen{$target} = $Not_Loaded_Yet{$target} = 1; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub flush_loaded { |
20
|
0
|
|
|
0
|
0
|
0
|
log_debug { "flushing the loaded classes" }; |
|
7
|
|
|
7
|
|
61
|
|
21
|
7
|
|
|
|
|
91
|
foreach my $key (keys %Not_Loaded_Yet) { |
22
|
4
|
|
|
0
|
|
78
|
log_trace { "flushing '$key'" }; |
|
0
|
|
|
|
|
0
|
|
23
|
4
|
|
|
4
|
|
35
|
my $data_fh = do { no strict 'refs'; *{"${key}::DATA"} }; |
|
4
|
|
|
|
|
6
|
|
|
4
|
|
|
|
|
1127
|
|
|
4
|
|
|
|
|
37
|
|
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
47
|
|
24
|
4
|
|
|
|
|
13
|
my $data = do { local $/; <$data_fh> }; |
|
4
|
|
|
|
|
19
|
|
|
4
|
|
|
|
|
129
|
|
25
|
4
|
|
|
|
|
82
|
my %modules = reverse( |
26
|
|
|
|
|
|
|
$data =~ m/(^package ([^;]+);\n.*?(?:(?=^package)|\Z))/msg |
27
|
|
|
|
|
|
|
); |
28
|
4
|
|
|
|
|
26
|
$_ .= "\n1;\n" for values %modules; |
29
|
4
|
|
|
|
|
19
|
@Modules{keys %modules} = values %modules; |
30
|
4
|
|
|
|
|
17
|
delete $Not_Loaded_Yet{$key}; |
31
|
|
|
|
|
|
|
} |
32
|
7
|
|
|
0
|
|
56
|
log_trace { "done flushing loaded classes" }; |
|
0
|
|
|
|
|
0
|
|
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub find_module { |
36
|
7
|
|
|
7
|
0
|
34
|
flush_loaded; |
37
|
7
|
|
|
|
|
63
|
my ($module) = @_; |
38
|
7
|
|
|
|
|
26
|
$module =~ s/\//::/g; |
39
|
7
|
|
|
|
|
30
|
$module =~ s/\.pm$//; |
40
|
7
|
|
|
|
|
32
|
return $Modules{$module}; |
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1; |