line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Attribute::Protected; |
2
|
|
|
|
|
|
|
|
3
|
1
|
|
|
1
|
|
25813
|
use 5.006; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
49
|
|
4
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
39
|
|
5
|
1
|
|
|
1
|
|
6
|
use warnings; |
|
1
|
|
|
|
|
5
|
|
|
1
|
|
|
|
|
80
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.03'; |
8
|
|
|
|
|
|
|
|
9
|
1
|
|
|
1
|
|
1120
|
use Attribute::Handlers; |
|
1
|
|
|
|
|
6418
|
|
|
1
|
|
|
|
|
7
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
sub UNIVERSAL::Protected : ATTR(CODE) { |
12
|
1
|
|
|
1
|
0
|
45
|
my($package, $symbol, $referent, $attr, $data, $phase) = @_; |
13
|
1
|
|
|
|
|
1
|
my $meth = *{$symbol}{NAME}; |
|
1
|
|
|
|
|
3
|
|
14
|
1
|
|
|
1
|
|
78
|
no warnings 'redefine'; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
112
|
|
15
|
1
|
|
|
|
|
5
|
*{$symbol} = sub { |
16
|
3
|
100
|
|
3
|
|
1304
|
unless (caller->isa($package)) { |
17
|
1
|
|
|
|
|
6
|
require Carp; |
18
|
1
|
|
|
|
|
78
|
Carp::croak "$meth() is a protected method of $package!"; |
19
|
|
|
|
|
|
|
} |
20
|
2
|
|
|
|
|
8
|
goto &$referent; |
21
|
1
|
|
|
|
|
5
|
}; |
22
|
1
|
|
|
1
|
|
5
|
} |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
6
|
|
23
|
|
|
|
|
|
|
|
24
|
|
|
|
|
|
|
sub UNIVERSAL::Private : ATTR(CODE) { |
25
|
1
|
|
|
1
|
0
|
5397
|
my($package, $symbol, $referent, $attr, $data, $phase) = @_; |
26
|
1
|
|
|
|
|
2
|
my $meth = *{$symbol}{NAME}; |
|
1
|
|
|
|
|
3
|
|
27
|
1
|
|
|
1
|
|
274
|
no warnings 'redefine'; |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
106
|
|
28
|
1
|
|
|
|
|
5
|
*{$symbol} = sub { |
29
|
3
|
100
|
|
3
|
|
998
|
unless (caller eq $package) { |
30
|
2
|
|
|
|
|
15
|
require Carp; |
31
|
2
|
|
|
|
|
372
|
Carp::croak "$meth() is a private method of $package!"; |
32
|
|
|
|
|
|
|
} |
33
|
1
|
|
|
|
|
6
|
goto &$referent; |
34
|
1
|
|
|
|
|
6
|
}; |
35
|
1
|
|
|
1
|
|
5
|
} |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
4
|
|
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub UNIVERSAL::Public : ATTR(CODE) { |
38
|
1
|
|
|
1
|
0
|
78
|
my($package, $symbol, $referent, $attr, $data, $phase) = @_; |
39
|
|
|
|
|
|
|
# just a mark, do nothing |
40
|
1
|
|
|
1
|
|
282
|
} |
|
1
|
|
|
|
|
1
|
|
|
1
|
|
|
|
|
4
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
__END__ |