line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tangerine::hook::moduleload; |
2
|
|
|
|
|
|
|
$Tangerine::hook::moduleload::VERSION = '0.20'; |
3
|
15
|
|
|
15
|
|
1125
|
use strict; |
|
15
|
|
|
|
|
29
|
|
|
15
|
|
|
|
|
375
|
|
4
|
15
|
|
|
15
|
|
72
|
use warnings; |
|
15
|
|
|
|
|
28
|
|
|
15
|
|
|
|
|
370
|
|
5
|
15
|
|
|
15
|
|
72
|
use parent 'Tangerine::Hook'; |
|
15
|
|
|
|
|
26
|
|
|
15
|
|
|
|
|
76
|
|
6
|
15
|
|
|
15
|
|
850
|
use List::Util 1.33 qw(any); |
|
15
|
|
|
|
|
266
|
|
|
15
|
|
|
|
|
900
|
|
7
|
15
|
|
|
15
|
|
83
|
use Tangerine::HookData; |
|
15
|
|
|
|
|
33
|
|
|
15
|
|
|
|
|
385
|
|
8
|
15
|
|
|
15
|
|
72
|
use Tangerine::Utils qw(stripquotelike); |
|
15
|
|
|
|
|
28
|
|
|
15
|
|
|
|
|
4405
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub run { |
11
|
143
|
|
|
143
|
1
|
207
|
my ($self, $s) = @_; |
12
|
143
|
|
|
|
|
349
|
my @routines = qw(load autoload load_remote autoload_remote); |
13
|
143
|
100
|
66
|
203
|
|
532
|
if ((any { $s->[0] eq $_ } qw(use no)) && scalar(@$s) > 1 && |
|
203
|
|
100
|
|
|
1165
|
|
14
|
|
|
|
|
|
|
$s->[1] eq 'Module::Load') { |
15
|
2
|
|
|
|
|
80
|
return Tangerine::HookData->new( hooks => [ |
16
|
|
|
|
|
|
|
Tangerine::hook::moduleload->new(type => 'runtime') ] ); |
17
|
|
|
|
|
|
|
} |
18
|
141
|
100
|
100
|
31
|
|
3052
|
if ($self->type eq 'runtime' && (any { $s->[0] eq $_ } @routines) && |
|
31
|
|
66
|
|
|
124
|
|
19
|
|
|
|
|
|
|
scalar(@$s) > 2) |
20
|
|
|
|
|
|
|
{ |
21
|
5
|
|
|
|
|
117
|
print "I would return: use ".join(' ', @$s[1..$#$s])."\n"; |
22
|
5
|
|
|
|
|
820
|
return Tangerine::HookData->new( |
23
|
|
|
|
|
|
|
children => [ 'use', stripquotelike($s->[1]), @$s[2..$#$s] ], |
24
|
|
|
|
|
|
|
type => 'runtime', |
25
|
|
|
|
|
|
|
); |
26
|
|
|
|
|
|
|
} |
27
|
136
|
|
|
|
|
569
|
return; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
__END__ |