line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Class::Data::Lazy; |
2
|
2
|
|
|
2
|
|
24746
|
use 5.008005; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
97
|
|
3
|
2
|
|
|
2
|
|
12
|
use strict; |
|
2
|
|
|
|
|
11
|
|
|
2
|
|
|
|
|
117
|
|
4
|
2
|
|
|
2
|
|
22
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
228
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
our $VERSION = "0.01"; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub import { |
9
|
2
|
|
|
2
|
|
17
|
my $class = shift; |
10
|
2
|
|
|
|
|
5
|
my $pkg = caller(0); |
11
|
|
|
|
|
|
|
|
12
|
2
|
|
|
|
|
11
|
for my $name (@_) { |
13
|
1
|
|
|
|
|
3
|
my $builder = "_build_${name}"; |
14
|
2
|
|
|
2
|
|
11
|
no strict 'refs'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
147
|
|
15
|
1
|
|
|
|
|
1841
|
*{"${pkg}::${name}"} = sub { |
16
|
1
|
|
|
1
|
|
994
|
my $class = shift; |
17
|
1
|
|
|
|
|
7
|
my $value = $class->$builder(); |
18
|
2
|
|
|
2
|
|
10
|
no warnings 'redefine'; |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
241
|
|
19
|
1
|
|
|
1
|
|
11
|
*{"${class}::${name}"} = sub { $value }; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
6
|
|
20
|
1
|
|
|
|
|
3
|
return $value; |
21
|
1
|
|
|
|
|
5
|
}; |
22
|
|
|
|
|
|
|
} |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
1; |
26
|
|
|
|
|
|
|
__END__ |