line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tie::Autotie; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
33003
|
use 5.006; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
46
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
39
|
|
5
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
7
|
|
|
1
|
|
|
|
|
132
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = 0.03; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
sub import { |
11
|
1
|
|
|
1
|
|
9
|
my ($class, $pkg, $use_args, $tie_args) = @_; |
12
|
|
|
|
|
|
|
|
13
|
1
|
|
50
|
|
|
9
|
$use_args ||= []; |
14
|
1
|
|
50
|
|
|
6
|
$tie_args ||= []; |
15
|
|
|
|
|
|
|
|
16
|
1
|
|
|
1
|
|
19661
|
eval "use $pkg \@\$use_args; 1;"; |
|
1
|
|
|
|
|
24421
|
|
|
1
|
|
|
|
|
27
|
|
|
1
|
|
|
|
|
75
|
|
17
|
|
|
|
|
|
|
|
18
|
1
|
|
|
1
|
|
6
|
no strict 'refs'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
46
|
|
19
|
1
|
|
|
1
|
|
5
|
no warnings 'redefine'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
771
|
|
20
|
|
|
|
|
|
|
|
21
|
1
|
|
|
|
|
3
|
*{$pkg . "::AUTOTIE_STORE"} = \&{$pkg . "::STORE"}; |
|
1
|
|
|
|
|
6
|
|
|
1
|
|
|
|
|
6
|
|
22
|
1
|
|
|
|
|
6408
|
*{$pkg . "::STORE"} = sub { |
23
|
16
|
|
|
16
|
|
528
|
my ($self, $key, $value) = @_; |
24
|
|
|
|
|
|
|
|
25
|
16
|
100
|
|
|
|
42
|
if (ref $value) { |
26
|
5
|
50
|
33
|
|
|
89
|
if (UNIVERSAL::isa($value, 'SCALAR') and $pkg->can('TIESCALAR')) { |
|
|
50
|
33
|
|
|
|
|
|
|
50
|
33
|
|
|
|
|
27
|
0
|
|
|
|
|
0
|
tie $$value, $pkg, @$tie_args; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
elsif (UNIVERSAL::isa($value, 'ARRAY') and $pkg->can('TIEARRAY')) { |
30
|
0
|
|
|
|
|
0
|
tie @$value, $pkg, @$tie_args; |
31
|
|
|
|
|
|
|
} |
32
|
|
|
|
|
|
|
elsif (UNIVERSAL::isa($value, 'HASH') and $pkg->can('TIEHASH')) { |
33
|
5
|
|
|
|
|
21
|
tie %$value, $pkg, @$tie_args; |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
16
|
|
|
|
|
102
|
$self->AUTOTIE_STORE($key, $value); |
38
|
1
|
|
|
|
|
9
|
}; |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |