line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Object::Tiny::RW; |
2
|
|
|
|
|
|
|
|
3
|
3
|
|
|
3
|
|
2466
|
use strict 'vars', 'subs'; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
159
|
|
4
|
|
|
|
|
|
|
BEGIN { |
5
|
3
|
|
|
3
|
|
78
|
require 5.004; |
6
|
3
|
|
|
|
|
899
|
$Object::Tiny::RW::VERSION = '1.07'; |
7
|
|
|
|
|
|
|
} |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub import { |
10
|
3
|
50
|
|
3
|
|
464
|
return unless shift eq 'Object::Tiny::RW'; |
11
|
3
|
|
|
|
|
9
|
my $pkg = caller; |
12
|
3
|
|
|
|
|
5
|
my $child = !! @{"${pkg}::ISA"}; |
|
3
|
|
|
|
|
16
|
|
13
|
5
|
100
|
33
|
|
|
80
|
eval join "\n", |
|
|
|
66
|
|
|
|
|
14
|
|
|
|
|
|
|
"package $pkg;", |
15
|
|
|
|
|
|
|
($child ? () : "\@${pkg}::ISA = 'Object::Tiny::RW';"), |
16
|
|
|
|
|
|
|
map { |
17
|
3
|
50
|
|
4
|
|
16
|
defined and ! ref and /^[^\W\d]\w*$/s |
|
4
|
100
|
|
4
|
|
19
|
|
|
1
|
100
|
|
|
|
3
|
|
|
4
|
|
|
|
|
17
|
|
|
4
|
|
|
|
|
5062
|
|
|
1
|
|
|
|
|
3
|
|
|
4
|
|
|
|
|
17
|
|
18
|
|
|
|
|
|
|
or die "Invalid accessor name '$_'"; |
19
|
4
|
|
|
|
|
282
|
"sub $_ { if (\@_ > 1) { \$_[0]->{$_} = \$_[1] } ; return \$_[0]->{$_} }\n" |
20
|
|
|
|
|
|
|
} @_; |
21
|
2
|
50
|
|
|
|
9
|
die "Failed to generate $pkg" if $@; |
22
|
2
|
|
|
|
|
28
|
return 1; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub new { |
26
|
2
|
|
|
2
|
0
|
2199
|
my $class = shift; |
27
|
2
|
|
|
|
|
11
|
bless { @_ }, $class; |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
1; |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
__END__ |