line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Class::Member; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
28797
|
use 5.008_000; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
43
|
|
4
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
57
|
|
5
|
|
|
|
|
|
|
our $VERSION='1.6'; |
6
|
|
|
|
|
|
|
|
7
|
1
|
|
|
1
|
|
6
|
use Carp 'confess'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
385
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub import { |
10
|
2
|
|
|
2
|
|
1927
|
my $pack=shift; |
11
|
2
|
|
|
|
|
7
|
($pack)=caller; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my $getset_hash=sub : lvalue { |
14
|
9
|
|
|
9
|
|
11
|
my $I=shift; |
15
|
9
|
|
|
|
|
14
|
my $what=shift; |
16
|
9
|
100
|
|
|
|
37
|
unless( UNIVERSAL::isa( $I, 'HASH' ) ) { |
17
|
1
|
|
|
|
|
303
|
confess "$pack\::$what must be called as instance method\n"; |
18
|
|
|
|
|
|
|
} |
19
|
8
|
|
|
|
|
39
|
$what=$pack.'::'.$what; |
20
|
8
|
100
|
|
|
|
24
|
if( $#_>=0 ) { |
21
|
2
|
|
|
|
|
5
|
$I->{$what}=shift; |
22
|
|
|
|
|
|
|
} |
23
|
8
|
|
|
|
|
64
|
$I->{$what}; |
24
|
2
|
|
|
|
|
9
|
}; |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
my $getset_glob=sub : lvalue { |
27
|
9
|
|
|
9
|
|
10
|
my $I=shift; |
28
|
9
|
|
|
|
|
13
|
my $what=shift; |
29
|
9
|
100
|
|
|
|
570
|
unless( UNIVERSAL::isa( $I, 'GLOB' ) ) { |
30
|
1
|
|
|
|
|
247
|
confess "$pack\::$what must be called as instance method\n"; |
31
|
|
|
|
|
|
|
} |
32
|
8
|
|
|
|
|
16
|
$what=$pack.'::'.$what; |
33
|
8
|
100
|
|
|
|
17
|
if( $#_>=0 ) { |
34
|
2
|
|
|
|
|
3
|
${*$I}{$what}=shift; |
|
2
|
|
|
|
|
6
|
|
35
|
|
|
|
|
|
|
} |
36
|
8
|
|
|
|
|
10
|
${*$I}{$what}; |
|
8
|
|
|
|
|
44
|
|
37
|
2
|
|
|
|
|
8
|
}; |
38
|
|
|
|
|
|
|
|
39
|
|
|
|
|
|
|
my $getset=sub : lvalue { |
40
|
4
|
|
|
4
|
|
60
|
my $I=shift; |
41
|
4
|
|
|
|
|
7
|
my $name=shift; |
42
|
|
|
|
|
|
|
|
43
|
4
|
100
|
|
|
|
25
|
if( UNIVERSAL::isa( $I, 'HASH' ) ) { |
|
|
50
|
|
|
|
|
|
44
|
1
|
|
|
1
|
|
7
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
46
|
|
45
|
1
|
|
|
1
|
|
5
|
no warnings 'redefine'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
101
|
|
46
|
2
|
|
|
|
|
12
|
*{$pack.'::'.$name}=sub:lvalue { |
47
|
9
|
|
|
9
|
|
20
|
my $I=shift; |
48
|
9
|
|
|
|
|
13
|
&{$getset_hash}( $I, $name, @_ ); |
|
9
|
|
|
|
|
24
|
|
49
|
2
|
|
|
|
|
13
|
}; |
50
|
|
|
|
|
|
|
} elsif( UNIVERSAL::isa( $I, 'GLOB' ) ) { |
51
|
1
|
|
|
1
|
|
5
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
26
|
|
52
|
1
|
|
|
1
|
|
5
|
no warnings 'redefine'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
170
|
|
53
|
2
|
|
|
|
|
8
|
*{$pack.'::'.$name}=sub:lvalue { |
54
|
9
|
|
|
9
|
|
21
|
my $I=shift; |
55
|
9
|
|
|
|
|
12
|
&{$getset_glob}( $I, $name, @_ ); |
|
9
|
|
|
|
|
21
|
|
56
|
2
|
|
|
|
|
11
|
}; |
57
|
|
|
|
|
|
|
} else { |
58
|
0
|
|
|
|
|
0
|
confess "$pack\::$name must be called as instance method\n"; |
59
|
|
|
|
|
|
|
} |
60
|
4
|
|
|
|
|
16
|
$I->$name(@_); |
61
|
2
|
|
|
|
|
10
|
}; |
62
|
|
|
|
|
|
|
|
63
|
2
|
|
|
|
|
5
|
foreach my $name (@_) { |
64
|
6
|
100
|
|
|
|
20
|
if( $name=~/^-(.*)/ ) { # reserved name, aka option |
65
|
2
|
50
|
|
|
|
9
|
if( $1 eq 'CLASS_MEMBERS' ) { |
66
|
2
|
|
|
|
|
3
|
local $_; |
67
|
1
|
|
|
1
|
|
6
|
no strict 'refs'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
80
|
|
68
|
2
|
|
|
|
|
3
|
*{$pack.'::CLASS_MEMBERS'}=[grep {!/^-/} @_]; |
|
2
|
|
|
|
|
2891
|
|
|
6
|
|
|
|
|
18
|
|
69
|
|
|
|
|
|
|
} |
70
|
|
|
|
|
|
|
} else { |
71
|
1
|
|
|
1
|
|
5
|
no strict 'refs'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
125
|
|
72
|
4
|
|
|
|
|
24
|
*{$pack.'::'.$name}=sub:lvalue { |
73
|
4
|
|
|
4
|
|
2401
|
my $I=shift; |
74
|
4
|
|
|
|
|
6
|
&{$getset}( $I, $name, @_ ); |
|
4
|
|
|
|
|
14
|
|
75
|
4
|
|
|
|
|
13
|
}; |
76
|
|
|
|
|
|
|
} |
77
|
|
|
|
|
|
|
} |
78
|
|
|
|
|
|
|
} |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
1; # make require fail |
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
__END__ |