line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Sub::Disable; |
2
|
10
|
|
|
10
|
|
159661
|
use 5.014; |
|
10
|
|
|
|
|
34
|
|
3
|
10
|
|
|
10
|
|
52
|
use strict; |
|
10
|
|
|
|
|
15
|
|
|
10
|
|
|
|
|
2092
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
our $VERSION = '1.02'; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
require XSLoader; |
8
|
|
|
|
|
|
|
XSLoader::load('Sub::Disable', $VERSION); |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub import { |
11
|
11
|
|
|
11
|
|
65
|
my $class = shift; |
12
|
11
|
100
|
|
|
|
105
|
return unless scalar @_; |
13
|
|
|
|
|
|
|
|
14
|
9
|
100
|
|
|
|
36
|
my $args = ref($_[0]) eq 'HASH' ? $_[0] : (scalar grep {ref $_} @_) ? {@_} : {any => \@_}; |
|
11
|
100
|
|
|
|
35
|
|
15
|
9
|
|
|
|
|
19
|
my $caller = caller; |
16
|
|
|
|
|
|
|
|
17
|
9
|
|
100
|
|
|
10
|
for my $func (@{$args->{method} // []}, @{$args->{any} // []}) { |
|
9
|
|
100
|
|
|
61
|
|
|
9
|
|
|
|
|
59
|
|
18
|
7
|
|
|
|
|
28
|
disable_method_call($caller, $func); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
9
|
|
100
|
|
|
14
|
for my $func (@{$args->{sub} // []}, @{$args->{any} // []}) { |
|
9
|
|
100
|
|
|
37
|
|
|
9
|
|
|
|
|
3116
|
|
22
|
9
|
|
|
|
|
5971
|
disable_named_call($caller, $func); |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
1; |
27
|
|
|
|
|
|
|
__END__ |