line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package OOP::Private; |
2
|
|
|
|
|
|
|
our $VERSION = "1.0"; |
3
|
|
|
|
|
|
|
|
4
|
3
|
|
|
3
|
|
145337
|
use strict; |
|
3
|
|
|
|
|
25
|
|
|
3
|
|
|
|
|
85
|
|
5
|
3
|
|
|
3
|
|
21
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
76
|
|
6
|
|
|
|
|
|
|
|
7
|
3
|
|
|
3
|
|
14
|
no warnings "redefine"; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
96
|
|
8
|
|
|
|
|
|
|
|
9
|
3
|
|
|
3
|
|
13
|
use Carp "croak"; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
179
|
|
10
|
3
|
|
|
3
|
|
1755
|
use Attribute::Handlers; |
|
3
|
|
|
|
|
13673
|
|
|
3
|
|
|
|
|
15
|
|
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
sub UNIVERSAL::Private :ATTR(CODE) { |
13
|
3
|
|
|
3
|
0
|
3390
|
my ($pkg, $sym, $fun) = @_; |
14
|
|
|
|
|
|
|
|
15
|
3
|
|
|
|
|
10
|
*{$sym} = sub { |
16
|
3
|
100
|
|
3
|
|
839
|
croak "Attempt to call private subroutine $pkg".'::'. *{$sym}{NAME} ." from outer code" |
|
2
|
|
|
|
|
311
|
|
17
|
|
|
|
|
|
|
unless caller eq $pkg; |
18
|
|
|
|
|
|
|
|
19
|
1
|
|
|
|
|
9
|
$fun -> (@_); |
20
|
3
|
|
|
|
|
15
|
}; |
21
|
3
|
|
|
3
|
|
373
|
} |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
21
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub UNIVERSAL::Protected :ATTR(CODE) { |
24
|
2
|
|
|
2
|
0
|
173
|
my ($pkg, $sym, $fun) = @_; |
25
|
|
|
|
|
|
|
|
26
|
2
|
|
|
|
|
6
|
*{$sym} = sub { |
27
|
3
|
100
|
100
|
3
|
|
2058
|
croak "Attempt to call protected subroutine $pkg".'::'. *{$sym}{NAME} ." from outer code" |
|
1
|
|
|
|
|
86
|
|
28
|
|
|
|
|
|
|
unless caller eq $pkg or caller -> UNIVERSAL::isa($pkg); |
29
|
|
|
|
|
|
|
|
30
|
2
|
|
|
|
|
9
|
$fun -> (@_); |
31
|
2
|
|
|
|
|
10
|
}; |
32
|
3
|
|
|
3
|
|
1086
|
} |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
12
|
|
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
1 |