line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Method::Cached::KeyRule; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
74
|
use strict; |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
293
|
|
4
|
5
|
|
|
5
|
|
28
|
use warnings; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
162
|
|
5
|
5
|
|
|
5
|
|
28
|
use Scalar::Util; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
410
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
{ |
8
|
5
|
|
|
5
|
|
24
|
no strict 'refs'; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
2471
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub regularize { |
11
|
103
|
|
|
103
|
0
|
160
|
my $key_rule = shift; |
12
|
103
|
|
|
|
|
173
|
my $ref = ref $key_rule; |
13
|
103
|
100
|
|
|
|
255
|
$ref || return &{$key_rule || 'LIST'}(@_); |
|
64
|
100
|
|
|
|
395
|
|
14
|
39
|
100
|
|
|
|
173
|
$ref eq 'CODE' && return $key_rule->(@_); |
15
|
15
|
|
|
|
|
17
|
my $key; |
16
|
15
|
|
|
|
|
19
|
for my $rule (@{$key_rule}) { |
|
15
|
|
|
|
|
113
|
|
17
|
30
|
100
|
|
|
|
74
|
$key = ref $rule ? $rule->(@_) : &{$rule}(@_); |
|
25
|
|
|
|
|
87
|
|
18
|
|
|
|
|
|
|
} |
19
|
15
|
|
|
|
|
52
|
return $key; |
20
|
|
|
|
|
|
|
} |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub SELF_SHIFT { |
24
|
5
|
|
|
5
|
0
|
8
|
my ($method_name, $args) = @_; |
25
|
5
|
|
|
|
|
8
|
shift @{$args}; |
|
5
|
|
|
|
|
120
|
|
26
|
5
|
|
|
|
|
17
|
return; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub PER_OBJECT { |
30
|
5
|
|
|
5
|
0
|
8
|
my ($method_name, $args) = @_; |
31
|
5
|
|
|
|
|
16
|
$args->[0] = Scalar::Util::refaddr $args->[0]; |
32
|
5
|
|
|
|
|
11
|
return; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
sub LIST { |
36
|
73
|
|
|
73
|
0
|
119
|
my ($method_name, $args) = @_; |
37
|
73
|
|
|
|
|
659
|
local $^W = 0; |
38
|
73
|
|
|
|
|
108
|
$method_name . join chr(28), @{$args}; |
|
73
|
|
|
|
|
509
|
|
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
sub HASH { |
42
|
6
|
|
|
6
|
0
|
8
|
my ($method_name, $args) = @_; |
43
|
6
|
|
|
|
|
24
|
local $^W = 0; |
44
|
6
|
|
|
|
|
9
|
my ($ser, %hash) = (q{}, @{$args}); |
|
6
|
|
|
|
|
17
|
|
45
|
12
|
100
|
|
|
|
90
|
map { |
46
|
6
|
|
|
|
|
28
|
$ser .= chr(28) . $_ . (defined $hash{$_} ? '=' . $hash{$_} : q{}) |
47
|
|
|
|
|
|
|
} sort keys %hash; |
48
|
6
|
|
|
|
|
38
|
$method_name . $ser; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
__END__ |