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