line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tangerine::hook::moduleload; |
2
|
|
|
|
|
|
|
$Tangerine::hook::moduleload::VERSION = '0.19'; |
3
|
15
|
|
|
15
|
|
767
|
use strict; |
|
15
|
|
|
|
|
22
|
|
|
15
|
|
|
|
|
455
|
|
4
|
15
|
|
|
15
|
|
61
|
use warnings; |
|
15
|
|
|
|
|
19
|
|
|
15
|
|
|
|
|
406
|
|
5
|
15
|
|
|
15
|
|
60
|
use parent 'Tangerine::Hook'; |
|
15
|
|
|
|
|
21
|
|
|
15
|
|
|
|
|
75
|
|
6
|
15
|
|
|
15
|
|
899
|
use List::MoreUtils qw(any); |
|
15
|
|
|
|
|
21
|
|
|
15
|
|
|
|
|
97
|
|
7
|
15
|
|
|
15
|
|
5325
|
use Tangerine::HookData; |
|
15
|
|
|
|
|
22
|
|
|
15
|
|
|
|
|
355
|
|
8
|
15
|
|
|
15
|
|
60
|
use Tangerine::Utils qw(stripquotelike); |
|
15
|
|
|
|
|
31
|
|
|
15
|
|
|
|
|
4218
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub run { |
11
|
139
|
|
|
139
|
1
|
158
|
my ($self, $s) = @_; |
12
|
139
|
|
|
|
|
300
|
my @routines = qw(load autoload load_remote autoload_remote); |
13
|
139
|
100
|
66
|
197
|
|
439
|
if ((any { $s->[0] eq $_ } qw(use no)) && scalar(@$s) > 1 && |
|
197
|
|
100
|
|
|
943
|
|
14
|
|
|
|
|
|
|
$s->[1] eq 'Module::Load') { |
15
|
2
|
|
|
|
|
48
|
return Tangerine::HookData->new( hooks => [ |
16
|
|
|
|
|
|
|
Tangerine::hook::moduleload->new(type => 'runtime') ] ); |
17
|
|
|
|
|
|
|
} |
18
|
137
|
100
|
100
|
31
|
|
2171
|
if ($self->type eq 'runtime' && (any { $s->[0] eq $_ } @routines) && |
|
31
|
|
66
|
|
|
87
|
|
19
|
|
|
|
|
|
|
scalar(@$s) > 2) |
20
|
|
|
|
|
|
|
{ |
21
|
5
|
|
|
|
|
76
|
print "I would return: use ".join(' ', @$s[1..$#$s])."\n"; |
22
|
5
|
|
|
|
|
827
|
return Tangerine::HookData->new( |
23
|
|
|
|
|
|
|
children => [ 'use', stripquotelike($s->[1]), @$s[2..$#$s] ], |
24
|
|
|
|
|
|
|
type => 'runtime', |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
} |
27
|
132
|
|
|
|
|
402
|
return; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
__END__ |