line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
1
|
|
|
1
|
|
416
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
22
|
|
2
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
27
|
|
3
|
|
|
|
|
|
|
|
4
|
|
|
|
|
|
|
package Pad::Tie::Plugin::Scalar; |
5
|
|
|
|
|
|
|
|
6
|
1
|
|
|
1
|
|
3
|
use base 'Pad::Tie::Plugin'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
209
|
|
7
|
|
|
|
|
|
|
|
8
|
1
|
|
|
1
|
1
|
2
|
sub provides { 'scalar' } |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub scalar { |
11
|
1
|
|
|
1
|
0
|
1
|
my ($plugin, $ctx, $self, $args) = @_; |
12
|
1
|
|
33
|
|
|
5
|
my $class = ref($plugin) || $plugin; |
13
|
1
|
|
|
|
|
6
|
$args = $plugin->canon_args($args); |
14
|
1
|
|
|
|
|
2
|
for my $method (keys %$args) { |
15
|
1
|
|
|
|
|
2
|
my $name = $args->{$method}; |
16
|
1
|
|
|
|
|
3
|
tie $ctx->{"\$$name"}, $class, $self, $method; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
} |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub TIESCALAR { |
21
|
1
|
|
|
1
|
|
1
|
my ($class, $inv, $method) = @_; |
22
|
1
|
|
|
|
|
8
|
return bless [ $inv, $method ] => $class; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub FETCH { |
26
|
1
|
|
|
1
|
|
23
|
my ($self, $method) = @{+shift}; |
|
1
|
|
|
|
|
4
|
|
27
|
1
|
|
|
|
|
2
|
return $self->$method; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub STORE { |
31
|
1
|
|
|
1
|
|
717
|
my ($self, $method) = @{+shift}; |
|
1
|
|
|
|
|
2
|
|
32
|
1
|
|
|
|
|
7
|
$self->$method(@_); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |