| 1 | package OOP::Private; | ||||||||||||||||||||||||||||
| 2 | 3 | our $VERSION = "1.0"; | |||||||||||||||||||||||||||
| 3 | |||||||||||||||||||||||||||||
| 4 | 3 | ▶ | use strict; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 5 | 3 | ▶ | use warnings; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||
| 7 | 3 | ▶ | no warnings "redefine"; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||
| 9 | 3 | ▶ | use Carp "croak"; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 10 | 3 | ▶ | use Attribute::Handlers; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||
| 12 | sub UNIVERSAL::Private :ATTR(CODE) { | ||||||||||||||||||||||||||||
| 13 | 3 | ▶ | my ($pkg, $sym, $fun) = @_; | ||||||||||||||||||||||||||
|
Subroutine
Private: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 14 | |||||||||||||||||||||||||||||
| 15 | 3 | *{$sym} = sub { | |||||||||||||||||||||||||||
| 16 | 3 | ▶ | croak "Attempt to call private subroutine $pkg".'::'. *{$sym}{NAME} ." from outer code" | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=2 SCAR=6.9
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 17 | unless caller eq $pkg; | ||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||
| 19 | 1 | $fun -> (@_); | |||||||||||||||||||||||||||
| 20 | 3 | }; | |||||||||||||||||||||||||||
| 21 | 3 | ▶ | } | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||
| 23 | sub UNIVERSAL::Protected :ATTR(CODE) { | ||||||||||||||||||||||||||||
| 24 | 2 | ▶ | my ($pkg, $sym, $fun) = @_; | ||||||||||||||||||||||||||
|
Subroutine
Protected: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||
| 26 | 2 | *{$sym} = sub { | |||||||||||||||||||||||||||
| 27 | 3 | ▶ | croak "Attempt to call protected subroutine $pkg".'::'. *{$sym}{NAME} ." from outer code" | ||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=3 SCAR=11.0
Branch: 1 branch
Condition100%3/3
caller eq $pkg or (caller)->UNIVERSAL::isa($pkg)
MC/DC100%2/2
caller eq $pkg or (caller)->UNIVERSAL::isa($pkg)
caller eq $pkg
(caller)->UNIVERSAL::isa($pkg)
Truth table100%3/3
A or B
A= caller eq $pkgB= (caller)->UNIVERSAL::isa($pkg)
| |||||||||||||||||||||||||||||
| 28 | unless caller eq $pkg or caller -> UNIVERSAL::isa($pkg); | ||||||||||||||||||||||||||||
| 29 | |||||||||||||||||||||||||||||
| 30 | 2 | $fun -> (@_); | |||||||||||||||||||||||||||
| 31 | 2 | }; | |||||||||||||||||||||||||||
| 32 | 3 | ▶ | } | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 33 | |||||||||||||||||||||||||||||
| 34 | 3 | 1 | |||||||||||||||||||||||||||