line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Sub::Lazy; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
77518
|
use 5.008; |
|
3
|
|
|
|
|
12
|
|
|
3
|
|
|
|
|
118
|
|
4
|
3
|
|
|
3
|
|
16
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
100
|
|
5
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
142
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
BEGIN { |
8
|
3
|
|
|
3
|
|
6
|
$Sub::Lazy::AUTHORITY = 'cpan:TOBYINK'; |
9
|
3
|
|
|
|
|
103
|
$Sub::Lazy::VERSION = '0.001'; |
10
|
|
|
|
|
|
|
} |
11
|
|
|
|
|
|
|
|
12
|
3
|
|
|
3
|
|
14
|
use constant ENABLED => !$ENV{PERL_SUB_LAZY_DISABLE}; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
264
|
|
13
|
|
|
|
|
|
|
|
14
|
3
|
|
|
3
|
|
6345
|
use Attribute::Handlers; |
|
3
|
|
|
|
|
26556
|
|
|
3
|
|
|
|
|
22
|
|
15
|
3
|
|
|
3
|
|
3500
|
use if ENABLED, 'Data::Thunk'; |
|
3
|
|
|
|
|
33
|
|
|
3
|
|
|
|
|
17
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub UNIVERSAL::Lazy :ATTR(CODE) |
18
|
|
|
|
|
|
|
{ |
19
|
6
|
|
|
6
|
0
|
4012
|
if (ENABLED) |
20
|
|
|
|
|
|
|
{ |
21
|
3
|
|
|
3
|
|
558991
|
no warnings qw(redefine); |
|
3
|
|
|
|
|
9
|
|
|
3
|
|
|
|
|
695
|
|
22
|
6
|
|
|
|
|
14
|
my ($package, $symbol, $referent, $attr, $data) = @_; |
23
|
6
|
100
|
|
|
|
8
|
my %args = @{ $data || [] }; |
|
6
|
|
|
|
|
32
|
|
24
|
|
|
|
|
|
|
$$symbol = $args{class} |
25
|
|
|
|
|
|
|
? sub { |
26
|
2
|
|
|
2
|
|
521
|
my @args = @_; |
27
|
2
|
|
|
2
|
|
18
|
Data::Thunk::lazy_object { $referent->(@args) } %args; |
|
2
|
|
|
|
|
2176
|
|
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
: sub { |
30
|
7
|
|
|
7
|
|
686
|
my @args = @_; |
31
|
7
|
|
|
7
|
|
41
|
Data::Thunk::lazy { $referent->(@args) }; |
|
7
|
|
|
|
|
2039
|
|
32
|
6
|
100
|
|
|
|
38
|
}; |
33
|
|
|
|
|
|
|
} |
34
|
6
|
|
|
|
|
12
|
1; |
35
|
3
|
|
|
3
|
|
19
|
} |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
28
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
ENABLED or not ENABLED # that is the question |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
__END__ |