line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
23436
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
50
|
|
2
|
|
|
|
|
|
|
package Class::Accessor::Lvalue; |
3
|
1
|
|
|
1
|
|
5
|
use base qw( Class::Accessor ); |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
995
|
|
4
|
1
|
|
|
1
|
|
1889
|
use Scalar::Util qw(weaken); |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
95
|
|
5
|
1
|
|
|
1
|
|
818
|
use Want qw( want ); |
|
1
|
|
|
|
|
2379
|
|
|
1
|
|
|
|
|
446
|
|
6
|
|
|
|
|
|
|
our $VERSION = '0.11'; |
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
sub make_accessor { |
9
|
2
|
|
|
2
|
1
|
1095
|
my ($class, $field) = @_; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
return sub :lvalue { |
12
|
12
|
|
|
12
|
|
1168
|
tie my $tie, "Class::Accessor::Lvalue::Tied" => $field, @_; |
13
|
12
|
|
|
|
|
41
|
$tie; |
14
|
2
|
|
|
|
|
9
|
}; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub make_ro_accessor { |
18
|
1
|
|
|
1
|
1
|
44
|
my ($class, $field) = @_; |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
return sub :lvalue { |
21
|
1
|
50
|
|
1
|
|
4
|
if (want 'LVALUE') { |
22
|
1
|
|
|
|
|
56
|
my $caller = caller; |
23
|
1
|
|
|
|
|
4
|
require Carp; |
24
|
1
|
|
|
|
|
178
|
Carp::croak("'$caller' cannot alter the value of '$field' on ". |
25
|
|
|
|
|
|
|
"objects of class '$class'"); |
26
|
|
|
|
|
|
|
} |
27
|
0
|
|
|
|
|
0
|
tie my $tie, "Class::Accessor::Lvalue::Tied" => $field, @_; |
28
|
0
|
|
|
|
|
0
|
$tie; |
29
|
1
|
|
|
|
|
6
|
}; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub make_wo_accessor { |
33
|
1
|
|
|
1
|
1
|
47
|
my($class, $field) = @_; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
return sub :lvalue { |
36
|
2
|
100
|
|
2
|
|
984
|
unless (want 'LVALUE') { |
37
|
1
|
|
|
|
|
42
|
my $caller = caller; |
38
|
1
|
|
|
|
|
5
|
require Carp; |
39
|
1
|
|
|
|
|
112
|
Carp::croak("'$caller' cannot access the value of '$field' on ". |
40
|
|
|
|
|
|
|
"objects of class '$class'"); |
41
|
|
|
|
|
|
|
} |
42
|
1
|
|
|
|
|
47
|
tie my $tie, "Class::Accessor::Lvalue::Tied" => $field, @_; |
43
|
1
|
|
|
|
|
3
|
$tie; |
44
|
1
|
|
|
|
|
6
|
}; |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
package Class::Accessor::Lvalue::Tied; |
49
|
13
|
|
|
13
|
|
17
|
sub TIESCALAR { shift; bless [@_] } |
|
13
|
|
|
|
|
34
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub STORE { |
52
|
7
|
|
|
7
|
|
18
|
my ($field, $self) = @{ shift() }; |
|
7
|
|
|
|
|
18
|
|
53
|
7
|
|
|
|
|
24
|
$self->set( $field, @_ ); |
54
|
|
|
|
|
|
|
} |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
sub FETCH { |
57
|
7
|
|
|
7
|
|
63
|
my ($field, $self) = @{ shift() }; |
|
7
|
|
|
|
|
11
|
|
58
|
7
|
|
|
|
|
22
|
$self->get( $field ); |
59
|
|
|
|
|
|
|
} |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
1; |
62
|
|
|
|
|
|
|
__END__ |