line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
28794
|
use 5.008; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
45
|
|
2
|
1
|
|
|
1
|
|
5
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
48
|
|
3
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
69
|
|
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
package LV::Backend::Magic; |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:TOBYINK'; |
8
|
|
|
|
|
|
|
our $VERSION = '0.006'; |
9
|
|
|
|
|
|
|
|
10
|
1
|
|
|
1
|
|
4
|
use Carp; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
101
|
|
11
|
1
|
|
|
1
|
|
1101
|
use Variable::Magic qw( wizard cast ); |
|
1
|
|
|
|
|
1917
|
|
|
1
|
|
|
|
|
391
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my $wiz = wizard( |
14
|
|
|
|
|
|
|
data => sub { $_[1] }, |
15
|
|
|
|
|
|
|
set => sub { $_[1]{set}->(${ $_[0] }); 0 }, |
16
|
|
|
|
|
|
|
get => sub { ${ $_[1]{var} } = $_[1]{get}->(); 0 }, |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub lvalue :lvalue |
20
|
|
|
|
|
|
|
{ |
21
|
5
|
|
|
5
|
0
|
35
|
my %args = @_; |
22
|
5
|
50
|
33
|
|
|
31
|
unless ($args{set} && $args{get}) |
23
|
|
|
|
|
|
|
{ |
24
|
0
|
|
|
|
|
0
|
my $caller = (caller(1))[3]; |
25
|
0
|
|
0
|
0
|
|
0
|
$args{get} ||= sub { require Carp; Carp::croak("$caller is writeonly") }; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
26
|
0
|
|
0
|
0
|
|
0
|
$args{set} ||= sub { require Carp; Carp::croak("$caller is readonly") }; |
|
0
|
|
|
|
|
0
|
|
|
0
|
|
|
|
|
0
|
|
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
5
|
|
|
|
|
10
|
$args{var} = \(my $var); |
30
|
5
|
|
|
|
|
27
|
cast($var, $wiz, \%args); |
31
|
5
|
|
|
|
|
26
|
$var; |
32
|
|
|
|
|
|
|
} |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1; |