line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OOP::Private; |
2
|
|
|
|
|
|
|
our $VERSION = "1.01"; |
3
|
|
|
|
|
|
|
|
4
|
3
|
|
|
3
|
|
152936
|
use strict; |
|
3
|
|
|
|
|
25
|
|
|
3
|
|
|
|
|
87
|
|
5
|
3
|
|
|
3
|
|
15
|
use warnings; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
78
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
15
|
no warnings "redefine"; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
96
|
|
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
15
|
use Carp "croak"; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
185
|
|
10
|
3
|
|
|
3
|
|
1852
|
use Attribute::Handlers; |
|
3
|
|
|
|
|
13461
|
|
|
3
|
|
|
|
|
50
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub UNIVERSAL::Private :ATTR(CODE) { |
13
|
3
|
|
|
3
|
0
|
3390
|
my ($pkg, $sym, $fun) = @_; |
14
|
|
|
|
|
|
|
|
15
|
3
|
|
|
|
|
11
|
*{$sym} = sub { |
16
|
3
|
100
|
|
3
|
|
862
|
croak "Attempt to call private subroutine $pkg".'::'. *{$sym}{NAME} ." from outer code" |
|
2
|
|
|
|
|
312
|
|
17
|
|
|
|
|
|
|
unless caller eq $pkg; |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
|
|
7
|
$fun -> (@_); |
20
|
3
|
|
|
|
|
14
|
}; |
21
|
3
|
|
|
3
|
|
378
|
} |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
12
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub UNIVERSAL::Protected :ATTR(CODE) { |
24
|
2
|
|
|
2
|
0
|
100
|
my ($pkg, $sym, $fun) = @_; |
25
|
|
|
|
|
|
|
|
26
|
2
|
|
|
|
|
10
|
*{$sym} = sub { |
27
|
3
|
100
|
100
|
3
|
|
1991
|
croak "Attempt to call protected subroutine $pkg".'::'. *{$sym}{NAME} ." from outer code" |
|
1
|
|
|
|
|
87
|
|
28
|
|
|
|
|
|
|
unless caller eq $pkg or caller -> UNIVERSAL::isa($pkg); |
29
|
|
|
|
|
|
|
|
30
|
2
|
|
|
|
|
9
|
$fun -> (@_); |
31
|
2
|
|
|
|
|
10
|
}; |
32
|
3
|
|
|
3
|
|
1188
|
} |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
12
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1 |