line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Class::Property::RW::Lazy;
|
2
|
1
|
|
|
1
|
|
6
|
use strict; use warnings FATAL => 'all';
|
|
1
|
|
|
1
|
|
2
|
|
|
1
|
|
|
|
|
44
|
|
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
50
|
|
3
|
1
|
|
|
1
|
|
7
|
use parent 'Class::Property::RW';
|
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
sub TIESCALAR
|
6
|
|
|
|
|
|
|
{
|
7
|
3
|
|
|
3
|
|
6
|
my( $class, $field, $init, $flag_ref ) = @_;
|
8
|
3
|
|
|
|
|
20
|
return bless {
|
9
|
|
|
|
|
|
|
'field' => $field
|
10
|
|
|
|
|
|
|
, 'init' => $init
|
11
|
|
|
|
|
|
|
, 'flag_ref' => $flag_ref
|
12
|
|
|
|
|
|
|
}, $class;
|
13
|
|
|
|
|
|
|
}
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub STORE
|
16
|
|
|
|
|
|
|
{
|
17
|
2
|
|
|
2
|
|
5
|
my( $self, $value ) = @_;
|
18
|
2
|
|
|
|
|
9
|
$self->{'object'}->{$self->{'field'}} = $value;
|
19
|
2
|
50
|
|
|
|
8
|
if( not defined $self->{'flag_ref'}->{$self->{'object'}} )
|
20
|
|
|
|
|
|
|
{
|
21
|
2
|
|
|
|
|
5
|
$self->{'flag_ref'}->{$self->{'object'}} = $self->{'object'};
|
22
|
2
|
|
|
|
|
8
|
Scalar::Util::weaken($self->{'flag_ref'}->{$self->{'object'}});
|
23
|
|
|
|
|
|
|
}
|
24
|
2
|
|
|
|
|
6
|
return;
|
25
|
|
|
|
|
|
|
}
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub FETCH
|
28
|
|
|
|
|
|
|
{
|
29
|
4
|
|
|
4
|
|
53
|
my( $self ) = @_;
|
30
|
|
|
|
|
|
|
|
31
|
4
|
|
|
|
|
6
|
eval{
|
32
|
4
|
50
|
|
|
|
17
|
if( not defined $self->{'flag_ref'}->{$self->{'object'}} )
|
33
|
|
|
|
|
|
|
{
|
34
|
4
|
|
|
|
|
11
|
$self->{'flag_ref'}->{$self->{'object'}} = $self->{'object'};
|
35
|
4
|
|
|
|
|
14
|
Scalar::Util::weaken($self->{'flag_ref'}->{$self->{'object'}});
|
36
|
4
|
|
|
|
|
12
|
$self->{'object'}->{$self->{'field'}} = $self->{'init'}->($self->{'object'});
|
37
|
|
|
|
|
|
|
}
|
38
|
|
|
|
|
|
|
};
|
39
|
4
|
50
|
|
|
|
26
|
if( $@ )
|
40
|
|
|
|
|
|
|
{
|
41
|
1
|
|
|
1
|
|
2039
|
use Data::Dumper;
|
|
1
|
|
|
|
|
7924
|
|
|
1
|
|
|
|
|
72
|
|
42
|
1
|
|
|
1
|
|
7
|
use Carp qw(confess);
|
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
104
|
|
43
|
0
|
|
|
|
|
0
|
print Dumper($self);
|
44
|
0
|
0
|
|
|
|
0
|
confess $@ if $@;
|
45
|
|
|
|
|
|
|
}
|
46
|
|
|
|
|
|
|
|
47
|
4
|
|
|
|
|
12
|
return $self->{'object'}->{$self->{'field'}};
|
48
|
|
|
|
|
|
|
}
|
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
1; |