line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
19
|
use 5.006; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
45
|
|
2
|
1
|
|
|
1
|
|
4
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
33
|
|
3
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
362
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package LV::Backend::Tie; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
8
|
|
|
|
|
|
|
our $VERSION = '0.006'; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub lvalue :lvalue |
11
|
|
|
|
|
|
|
{ |
12
|
5
|
|
|
5
|
0
|
16
|
my %args = @_; |
13
|
5
|
|
|
|
|
29
|
tie(my $var, 'LV::Backend::Tie::TiedScalar', $args{get}, $args{set}); |
14
|
5
|
|
|
|
|
33
|
$var; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
package LV::Backend::Tie::TiedScalar; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
20
|
|
|
|
|
|
|
our $VERSION = '0.006'; |
21
|
|
|
|
|
|
|
our @CARP_NOT = qw( LV LV::Backend::Tie ); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub TIESCALAR |
24
|
|
|
|
|
|
|
{ |
25
|
5
|
|
|
5
|
|
7
|
my $class = shift; |
26
|
5
|
|
|
|
|
7
|
my ($get, $set) = @_; |
27
|
|
|
|
|
|
|
|
28
|
5
|
50
|
33
|
|
|
48
|
unless ($set && $get) |
29
|
|
|
|
|
|
|
{ |
30
|
0
|
|
|
|
|
0
|
my $caller = (caller(2))[3]; |
31
|
0
|
|
0
|
0
|
|
0
|
$get ||= sub { require Carp; Carp::croak("$caller is writeonly") }; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
32
|
0
|
|
0
|
0
|
|
0
|
$set ||= sub { require Carp; Carp::croak("$caller is readonly") }; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
5
|
|
|
|
|
26
|
bless [$get, $set] => $class; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub FETCH |
39
|
|
|
|
|
|
|
{ |
40
|
5
|
|
|
5
|
|
19
|
&{shift->[0]}; |
|
5
|
|
|
|
|
15
|
|
41
|
|
|
|
|
|
|
} |
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
sub STORE |
44
|
|
|
|
|
|
|
{ |
45
|
5
|
|
|
5
|
|
24
|
&{shift->[1]}; |
|
5
|
|
|
|
|
17
|
|
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
1; |