line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Sub::Lazy; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
250924
|
use 5.008; |
|
3
|
|
|
|
|
12
|
|
|
3
|
|
|
|
|
185
|
|
4
|
3
|
|
|
3
|
|
17
|
use strict; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
103
|
|
5
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
3
|
|
|
|
|
11
|
|
|
3
|
|
|
|
|
143
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
BEGIN { |
8
|
3
|
|
|
3
|
|
6
|
$Sub::Lazy::AUTHORITY = 'cpan:TOBYINK'; |
9
|
3
|
|
|
|
|
102
|
$Sub::Lazy::VERSION = '0.002'; |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
3
|
|
|
3
|
|
15
|
use constant ENABLED => !$ENV{PERL_SUB_LAZY_DISABLE}; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
364
|
|
13
|
|
|
|
|
|
|
|
14
|
3
|
|
|
3
|
|
92801
|
use Attribute::Handlers; |
|
3
|
|
|
|
|
31165
|
|
|
3
|
|
|
|
|
25
|
|
15
|
3
|
|
|
3
|
|
3732
|
use if ENABLED, 'Data::Thunk'; |
|
3
|
|
|
|
|
30
|
|
|
3
|
|
|
|
|
17
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub UNIVERSAL::Lazy :ATTR(CODE) |
18
|
|
|
|
|
|
|
{ |
19
|
6
|
|
|
6
|
0
|
4506
|
if (ENABLED) |
20
|
|
|
|
|
|
|
{ |
21
|
3
|
|
|
3
|
|
1004118
|
no warnings qw(redefine); |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
547
|
|
22
|
6
|
|
|
|
|
14
|
my ($package, $symbol, $referent, $attr, $data) = @_; |
23
|
6
|
100
|
|
|
|
7
|
my %args = @{ $data || [] }; |
|
6
|
|
|
|
|
38
|
|
24
|
|
|
|
|
|
|
$$symbol = $args{class} |
25
|
|
|
|
|
|
|
? sub { |
26
|
2
|
|
|
2
|
|
1001
|
my @args = @_; |
27
|
2
|
|
|
2
|
|
21
|
Data::Thunk::lazy_object { $referent->(@args) } %args; |
|
2
|
|
|
|
|
3983
|
|
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
: sub { |
30
|
7
|
|
|
7
|
|
995
|
my @args = @_; |
31
|
7
|
|
|
7
|
|
43
|
Data::Thunk::lazy { $referent->(@args) }; |
|
7
|
|
|
|
|
3302
|
|
32
|
6
|
100
|
|
|
|
51
|
}; |
33
|
|
|
|
|
|
|
} |
34
|
6
|
|
|
|
|
14
|
1; |
35
|
3
|
|
|
3
|
|
17
|
} |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
26
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
ENABLED or not ENABLED # that is the question |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |