| 1 | package NEXT; | ||||||||||||||||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||||||||||||||||
| 3 | 6 | ▶ | use Carp; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 4 | 6 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 5 | 6 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 6 | 6 | ▶ | use overload (); | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 7 | |||||||||||||||||||||||||||||||||||||||||||
| 8 | 6 | our $VERSION = '0.69'; | |||||||||||||||||||||||||||||||||||||||||
| 9 | |||||||||||||||||||||||||||||||||||||||||||
| 10 | sub NEXT::ELSEWHERE::ancestors | ||||||||||||||||||||||||||||||||||||||||||
| 11 | 22 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
ancestors: called CC=2 SCAR=6.9
| |||||||||||||||||||||||||||||||||||||||||||
| 12 | 22 | my @inlist = shift; | |||||||||||||||||||||||||||||||||||||||||
| 13 | 22 | my @outlist = (); | |||||||||||||||||||||||||||||||||||||||||
| 14 | 22 | ▶ | while (my $next = shift @inlist) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 15 | 132 | push @outlist, $next; | |||||||||||||||||||||||||||||||||||||||||
| 16 | 6 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 17 | 132 | unshift @inlist, @{"$outlist[-1]::ISA"}; | |||||||||||||||||||||||||||||||||||||||||
| 18 | } | ||||||||||||||||||||||||||||||||||||||||||
| 19 | 22 | return @outlist; | |||||||||||||||||||||||||||||||||||||||||
| 20 | } | ||||||||||||||||||||||||||||||||||||||||||
| 21 | |||||||||||||||||||||||||||||||||||||||||||
| 22 | sub NEXT::ELSEWHERE::ordered_ancestors | ||||||||||||||||||||||||||||||||||||||||||
| 23 | 3 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
ordered_ancestors: called CC=4 SCAR=13.9
| |||||||||||||||||||||||||||||||||||||||||||
| 24 | 3 | my @inlist = shift; | |||||||||||||||||||||||||||||||||||||||||
| 25 | 3 | my @outlist = (); | |||||||||||||||||||||||||||||||||||||||||
| 26 | 3 | ▶ | while (my $next = shift @inlist) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 27 | 7 | push @outlist, $next; | |||||||||||||||||||||||||||||||||||||||||
| 28 | 6 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 29 | 7 | push @inlist, @{"$outlist[-1]::ISA"}; | |||||||||||||||||||||||||||||||||||||||||
| 30 | } | ||||||||||||||||||||||||||||||||||||||||||
| 31 | 3 | ▶ | return sort { $a->isa($b) ? -1 | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 32 | : $b->isa($a) ? +1 | ||||||||||||||||||||||||||||||||||||||||||
| 33 | : 0 } @outlist; | ||||||||||||||||||||||||||||||||||||||||||
| 34 | } | ||||||||||||||||||||||||||||||||||||||||||
| 35 | |||||||||||||||||||||||||||||||||||||||||||
| 36 | sub NEXT::ELSEWHERE::buildAUTOLOAD | ||||||||||||||||||||||||||||||||||||||||||
| 37 | 48 | ▶ | { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
buildAUTOLOAD: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 38 | 48 | my $autoload_name = caller() . '::AUTOLOAD'; | |||||||||||||||||||||||||||||||||||||||||
| 39 | |||||||||||||||||||||||||||||||||||||||||||
| 40 | 6 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 41 | 48 | ▶ | *{$autoload_name} = sub { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=25 SCAR=32.2
| |||||||||||||||||||||||||||||||||||||||||||
| 42 | 54 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 43 | 54 | my $depth = 1; | |||||||||||||||||||||||||||||||||||||||||
| 44 | 54 | ▶ | until (((caller($depth))[3]||q{}) !~ /^\(eval\)$/) { $depth++ } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
(caller $depth)[3] || ''
MC/DC0%0/1
(caller $depth)[3] || ''
(caller $depth)[3]
Truth table50%1/2
A
A= (caller $depth)[3]
| |||||||||||||||||||||||||||||||||||||||||||
| 45 | 54 | my $caller = (caller($depth))[3]; | |||||||||||||||||||||||||||||||||||||||||
| 46 | 54 | ▶ | my $wanted = $NEXT::AUTOLOAD || $autoload_name; | ||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
$NEXT::AUTOLOAD || $autoload_name
MC/DC0%0/2
$NEXT::AUTOLOAD || $autoload_name
$NEXT::AUTOLOAD
$autoload_name
Truth table66%2/3
A || B
A= $NEXT::AUTOLOADB= $autoload_name
| |||||||||||||||||||||||||||||||||||||||||||
| 47 | 54 | undef $NEXT::AUTOLOAD; | |||||||||||||||||||||||||||||||||||||||||
| 48 | 54 | my ($caller_class, $caller_method) = do { $caller =~ m{(.*)::(.*)}g }; | |||||||||||||||||||||||||||||||||||||||||
| 49 | 54 | my ($wanted_class, $wanted_method) = do { $wanted =~ m{(.*)::(.*)}g }; | |||||||||||||||||||||||||||||||||||||||||
| 50 | 54 | ▶ | croak "Can't call $wanted from $caller" | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 51 | unless $caller_method eq $wanted_method; | ||||||||||||||||||||||||||||||||||||||||||
| 52 | |||||||||||||||||||||||||||||||||||||||||||
| 53 | 51 | ▶ | my $key = ref $self && overload::Overloaded($self) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
ref $self and overload::Overloaded($self)
MC/DC0%0/2
ref $self and overload::Overloaded($self)
ref $self
overload::Overloaded($self)
Truth table66%2/3
A and B
A= ref $selfB= overload::Overloaded($self)
| |||||||||||||||||||||||||||||||||||||||||||
| 54 | ? overload::StrVal($self) : $self; | ||||||||||||||||||||||||||||||||||||||||||
| 55 | |||||||||||||||||||||||||||||||||||||||||||
| 56 | local ($NEXT::NEXT{$key,$wanted_method}, $NEXT::SEEN) = | ||||||||||||||||||||||||||||||||||||||||||
| 57 | 51 | ($NEXT::NEXT{$key,$wanted_method}, $NEXT::SEEN); | |||||||||||||||||||||||||||||||||||||||||
| 58 | |||||||||||||||||||||||||||||||||||||||||||
| 59 | 51 | ▶ | unless ($NEXT::NEXT{$key,$wanted_method}) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 60 | 22 | ▶ | my @forebears = | ||||||||||||||||||||||||||||||||||||||||
|
Condition66%2/3
ref $self || $self
MC/DC0%0/2
ref $self || $self
ref $self
$self
Truth table66%2/3
A || B
A= ref $selfB= $self
| |||||||||||||||||||||||||||||||||||||||||||
| 61 | NEXT::ELSEWHERE::ancestors ref $self || $self, | ||||||||||||||||||||||||||||||||||||||||||
| 62 | $wanted_class; | ||||||||||||||||||||||||||||||||||||||||||
| 63 | 22 | ▶ | while (@forebears) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 64 | 35 | ▶ | last if shift @forebears eq $caller_class | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 65 | } | ||||||||||||||||||||||||||||||||||||||||||
| 66 | 6 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 67 | # Use *{"..."} when first accessing the CODE slot, to make sure | ||||||||||||||||||||||||||||||||||||||||||
| 68 | # any typeglob stub is upgraded to a full typeglob. | ||||||||||||||||||||||||||||||||||||||||||
| 69 | 17 | @{$NEXT::NEXT{$key,$wanted_method}} = | |||||||||||||||||||||||||||||||||||||||||
| 70 | map { | ||||||||||||||||||||||||||||||||||||||||||
| 71 | 22 | ▶ | my $stash = \%{"${_}::"}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 72 | 49 | ($stash->{$caller_method} && (*{"${_}::$caller_method"}{CODE})) | |||||||||||||||||||||||||||||||||||||||||
| 73 | 47 | ? *{$stash->{$caller_method}}{CODE} | |||||||||||||||||||||||||||||||||||||||||
| 74 | 73 | ▶ | : () } @forebears | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
$stash->{$caller_method} and *{"${_}::$caller_method";}{"CODE"}
MC/DC100%1/1
$stash->{$caller_method} and *{"${_}::$caller_method";}{"CODE"}
$stash->{$caller_method}
Truth table100%2/2
A
A= $stash->{$caller_method}
| |||||||||||||||||||||||||||||||||||||||||||
| 75 | unless $wanted_method eq 'AUTOLOAD'; | ||||||||||||||||||||||||||||||||||||||||||
| 76 | 8 | @{$NEXT::NEXT{$key,$wanted_method}} = | |||||||||||||||||||||||||||||||||||||||||
| 77 | map { | ||||||||||||||||||||||||||||||||||||||||||
| 78 | 35 | my $stash = \%{"${_}::"}; | |||||||||||||||||||||||||||||||||||||||||
| 79 | 35 | ▶ | ($stash->{AUTOLOAD} && (*{"${_}::AUTOLOAD"}{CODE})) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
$stash->{"AUTOLOAD"} and *{"${_}::AUTOLOAD";}{"CODE"}
MC/DC100%1/1
$stash->{"AUTOLOAD"} and *{"${_}::AUTOLOAD";}{"CODE"}
$stash->{"AUTOLOAD"}
Truth table100%2/2
A
A= $stash->{"AUTOLOAD"}
| |||||||||||||||||||||||||||||||||||||||||||
| 80 | ? "${_}::AUTOLOAD" | ||||||||||||||||||||||||||||||||||||||||||
| 81 | : () } @forebears | ||||||||||||||||||||||||||||||||||||||||||
| 82 | 22 | ▶ | unless @{$NEXT::NEXT{$key,$wanted_method}||[]}; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%2/2
$NEXT::NEXT{join $;, $key, $wanted_method} || []
MC/DC100%1/1
$NEXT::NEXT{join $;, $key, $wanted_method} || []
$NEXT::NEXT{join $;, $key, $wanted_method}
Truth table100%2/2
A
A= $NEXT::NEXT{join $;, $key, $wanted_method}
| |||||||||||||||||||||||||||||||||||||||||||
| 83 | 22 | $NEXT::SEEN->{$key,*{$caller}{CODE}}++; | |||||||||||||||||||||||||||||||||||||||||
| 84 | } | ||||||||||||||||||||||||||||||||||||||||||
| 85 | 51 | my $call_method = shift @{$NEXT::NEXT{$key,$wanted_method}}; | |||||||||||||||||||||||||||||||||||||||||
| 86 | 51 | ▶ | while (do { $wanted_class =~ /^NEXT\b.*\b(UNSEEN|DISTINCT)\b/ } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition100%6/6
do {
$wanted_class =~ /^NEXT\b.*\b(UNSEEN|DISTINCT)\b/
} and defined $call_method and $$NEXT::SEEN{join $;, $key, $call_method}++
do {
$wanted_class =~ /^NEXT\b.*\b(UNSEEN|DISTINCT)\b/
} and defined $call_method
MC/DC100%3/3
do {
$wanted_class =~ /^NEXT\b.*\b(UNSEEN|DISTINCT)\b/
} and defined $call_method and $$NEXT::SEEN{join $;, $key, $call_method}++
do {
$wanted_class =~ /^NEXT\b.*\b(UNSEEN|DISTINCT)\b/
}
defined $call_method
$$NEXT::SEEN{join $;, $key, $call_method}++
Truth table100%4/4
A and B and C
A= do {
$wanted_class =~ /^NEXT\b.*\b(UNSEEN|DISTINCT)\b/
}B= defined $call_methodC= $$NEXT::SEEN{join $;, $key, $call_method}++
| |||||||||||||||||||||||||||||||||||||||||||
| 87 | && defined $call_method | ||||||||||||||||||||||||||||||||||||||||||
| 88 | && $NEXT::SEEN->{$key,$call_method}++) { | ||||||||||||||||||||||||||||||||||||||||||
| 89 | 9 | $call_method = shift @{$NEXT::NEXT{$key,$wanted_method}}; | |||||||||||||||||||||||||||||||||||||||||
| 90 | } | ||||||||||||||||||||||||||||||||||||||||||
| 91 | 51 | ▶ | unless (defined $call_method) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 92 | 7 | ▶ | return unless do { $wanted_class =~ /^NEXT:.*:ACTUAL/ }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 93 | 2 | (local $Carp::CarpLevel)++; | |||||||||||||||||||||||||||||||||||||||||
| 94 | 2 | croak qq(Can't locate object method "$wanted_method" ), | |||||||||||||||||||||||||||||||||||||||||
| 95 | qq(via package "$caller_class"); | ||||||||||||||||||||||||||||||||||||||||||
| 96 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 97 | 44 | ▶ | return $self->$call_method(@_[1..$#_]) if ref $call_method eq 'CODE'; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 98 | 6 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 99 | 10 | ▶ | do { ($wanted_method=${$caller_class."::AUTOLOAD"}) =~ s/.*::// } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 100 | if $wanted_method eq 'AUTOLOAD'; | ||||||||||||||||||||||||||||||||||||||||||
| 101 | 10 | $$call_method = $caller_class."::NEXT::".$wanted_method; | |||||||||||||||||||||||||||||||||||||||||
| 102 | 10 | return $call_method->(@_); | |||||||||||||||||||||||||||||||||||||||||
| 103 | 48 | }; | |||||||||||||||||||||||||||||||||||||||||
| 104 | } | ||||||||||||||||||||||||||||||||||||||||||
| 105 | |||||||||||||||||||||||||||||||||||||||||||
| 106 | 6 | ▶ | no strict 'vars'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 107 | 6 | package NEXT; NEXT::ELSEWHERE::buildAUTOLOAD(); | |||||||||||||||||||||||||||||||||||||||||
| 108 | 6 | package NEXT::UNSEEN; @ISA = 'NEXT'; NEXT::ELSEWHERE::buildAUTOLOAD(); | |||||||||||||||||||||||||||||||||||||||||
| 109 | 6 | package NEXT::DISTINCT; @ISA = 'NEXT'; NEXT::ELSEWHERE::buildAUTOLOAD(); | |||||||||||||||||||||||||||||||||||||||||
| 110 | 6 | package NEXT::ACTUAL; @ISA = 'NEXT'; NEXT::ELSEWHERE::buildAUTOLOAD(); | |||||||||||||||||||||||||||||||||||||||||
| 111 | 6 | package NEXT::ACTUAL::UNSEEN; @ISA = 'NEXT'; NEXT::ELSEWHERE::buildAUTOLOAD(); | |||||||||||||||||||||||||||||||||||||||||
| 112 | 6 | package NEXT::ACTUAL::DISTINCT; @ISA = 'NEXT'; NEXT::ELSEWHERE::buildAUTOLOAD(); | |||||||||||||||||||||||||||||||||||||||||
| 113 | 6 | package NEXT::UNSEEN::ACTUAL; @ISA = 'NEXT'; NEXT::ELSEWHERE::buildAUTOLOAD(); | |||||||||||||||||||||||||||||||||||||||||
| 114 | 6 | package NEXT::DISTINCT::ACTUAL; @ISA = 'NEXT'; NEXT::ELSEWHERE::buildAUTOLOAD(); | |||||||||||||||||||||||||||||||||||||||||
| 115 | |||||||||||||||||||||||||||||||||||||||||||
| 116 | package | ||||||||||||||||||||||||||||||||||||||||||
| 117 | EVERY; | ||||||||||||||||||||||||||||||||||||||||||
| 118 | |||||||||||||||||||||||||||||||||||||||||||
| 119 | 12 | ▶ | sub EVERY::ELSEWHERE::buildAUTOLOAD { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
buildAUTOLOAD: called CC=1 SCAR=0.6
| |||||||||||||||||||||||||||||||||||||||||||
| 120 | 12 | my $autoload_name = caller() . '::AUTOLOAD'; | |||||||||||||||||||||||||||||||||||||||||
| 121 | |||||||||||||||||||||||||||||||||||||||||||
| 122 | 6 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 123 | 12 | ▶ | *{$autoload_name} = sub { | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
__ANON__: called CC=21 SCAR=40.1
| |||||||||||||||||||||||||||||||||||||||||||
| 124 | 5 | my ($self) = @_; | |||||||||||||||||||||||||||||||||||||||||
| 125 | 5 | my $depth = 1; | |||||||||||||||||||||||||||||||||||||||||
| 126 | 0 | ▶ | until (((caller($depth))[3]||q{}) !~ /^\(eval\)$/) { $depth++ } | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition50%1/2
(caller $depth)[3] || ''
MC/DC0%0/1
(caller $depth)[3] || ''
(caller $depth)[3]
Truth table50%1/2
A
A= (caller $depth)[3]
| |||||||||||||||||||||||||||||||||||||||||||
| 127 | 5 | my $caller = (caller($depth))[3]; | |||||||||||||||||||||||||||||||||||||||||
| 128 | 5 | ▶ | my $wanted = $EVERY::AUTOLOAD || $autoload_name; | ||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
$AUTOLOAD || $autoload_name
MC/DC0%0/2
$AUTOLOAD || $autoload_name
$AUTOLOAD
$autoload_name
Truth table33%1/3
A || B
A= $AUTOLOADB= $autoload_name
| |||||||||||||||||||||||||||||||||||||||||||
| 129 | 5 | undef $EVERY::AUTOLOAD; | |||||||||||||||||||||||||||||||||||||||||
| 130 | 5 | my ($wanted_class, $wanted_method) = do { $wanted =~ m{(.*)::(.*)}g }; | |||||||||||||||||||||||||||||||||||||||||
| 131 | |||||||||||||||||||||||||||||||||||||||||||
| 132 | 5 | ▶ | my $key = ref($self) && overload::Overloaded($self) | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
ref $self and overload::Overloaded($self)
MC/DC50%1/2
ref $self and overload::Overloaded($self)
ref $self
overload::Overloaded($self)
Truth table66%2/3
A and B
A= ref $selfB= overload::Overloaded($self)
| |||||||||||||||||||||||||||||||||||||||||||
| 133 | ? overload::StrVal($self) : $self; | ||||||||||||||||||||||||||||||||||||||||||
| 134 | |||||||||||||||||||||||||||||||||||||||||||
| 135 | local $NEXT::ALREADY_IN_EVERY{$key,$wanted_method} = | ||||||||||||||||||||||||||||||||||||||||||
| 136 | 5 | $NEXT::ALREADY_IN_EVERY{$key,$wanted_method}; | |||||||||||||||||||||||||||||||||||||||||
| 137 | |||||||||||||||||||||||||||||||||||||||||||
| 138 | 5 | ▶ | return if $NEXT::ALREADY_IN_EVERY{$key,$wanted_method}++; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 139 | |||||||||||||||||||||||||||||||||||||||||||
| 140 | 3 | ▶ | my @forebears = NEXT::ELSEWHERE::ordered_ancestors ref $self || $self, | ||||||||||||||||||||||||||||||||||||||||
|
Condition33%1/3
ref $self || $self
MC/DC0%0/2
ref $self || $self
ref $self
$self
Truth table33%1/3
A || B
A= ref $selfB= $self
| |||||||||||||||||||||||||||||||||||||||||||
| 141 | $wanted_class; | ||||||||||||||||||||||||||||||||||||||||||
| 142 | 3 | ▶ | @forebears = reverse @forebears if do { $wanted_class =~ /\bLAST\b/ }; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 143 | 6 | ▶ | no strict 'refs'; | ||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||
| 144 | 3 | my %seen; | |||||||||||||||||||||||||||||||||||||||||
| 145 | 3 | ▶ | my @every = map { my $sub = "${_}::$wanted_method"; | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 146 | 7 | ▶ | !*{$sub}{CODE} || $seen{$sub}++ ? () : $sub | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
not *{$sub;}{"CODE"} or $seen{$sub}++
MC/DC50%1/2
not *{$sub;}{"CODE"} or $seen{$sub}++
not *{$sub;}{"CODE"}
$seen{$sub}++
Truth table66%2/3
not(A) or B
A= not *{$sub;}{"CODE"}B= $seen{$sub}++
| |||||||||||||||||||||||||||||||||||||||||||
| 147 | } @forebears | ||||||||||||||||||||||||||||||||||||||||||
| 148 | unless $wanted_method eq 'AUTOLOAD'; | ||||||||||||||||||||||||||||||||||||||||||
| 149 | |||||||||||||||||||||||||||||||||||||||||||
| 150 | 3 | my $want = wantarray; | |||||||||||||||||||||||||||||||||||||||||
| 151 | 3 | ▶ | if (@every) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||||||||||||||||
| 152 | 3 | ▶ | if ($want) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 153 | 1 | return map {($_, [$self->$_(@_[1..$#_])])} @every; | |||||||||||||||||||||||||||||||||||||||||
| 154 | } | ||||||||||||||||||||||||||||||||||||||||||
| 155 | elsif (defined $want) { | ||||||||||||||||||||||||||||||||||||||||||
| 156 | 2 | return { map {($_, scalar($self->$_(@_[1..$#_])))} | |||||||||||||||||||||||||||||||||||||||||
| 157 | @every | ||||||||||||||||||||||||||||||||||||||||||
| 158 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 159 | } | ||||||||||||||||||||||||||||||||||||||||||
| 160 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 161 | 0 | $self->$_(@_[1..$#_]) for @every; | |||||||||||||||||||||||||||||||||||||||||
| 162 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 163 | } | ||||||||||||||||||||||||||||||||||||||||||
| 164 | } | ||||||||||||||||||||||||||||||||||||||||||
| 165 | |||||||||||||||||||||||||||||||||||||||||||
| 166 | 0 | @every = map { my $sub = "${_}::AUTOLOAD"; | |||||||||||||||||||||||||||||||||||||||||
| 167 | 0 | ▶ | !*{$sub}{CODE} || $seen{$sub}++ ? () : "${_}::AUTOLOAD" | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition0%0/3
not *{$sub;}{"CODE"} or $seen{$sub}++
MC/DC0%0/2
not *{$sub;}{"CODE"} or $seen{$sub}++
not *{$sub;}{"CODE"}
$seen{$sub}++
Truth table0%0/3
not(A) or B
A= not *{$sub;}{"CODE"}B= $seen{$sub}++
| |||||||||||||||||||||||||||||||||||||||||||
| 168 | } @forebears; | ||||||||||||||||||||||||||||||||||||||||||
| 169 | 0 | ▶ | if ($want) { | ||||||||||||||||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||||||||||||||||
| 170 | 0 | return map { $$_ = ref($self)."::EVERY::".$wanted_method; | |||||||||||||||||||||||||||||||||||||||||
| 171 | 0 | ($_, [$self->$_(@_[1..$#_])]); | |||||||||||||||||||||||||||||||||||||||||
| 172 | } @every; | ||||||||||||||||||||||||||||||||||||||||||
| 173 | } | ||||||||||||||||||||||||||||||||||||||||||
| 174 | elsif (defined $want) { | ||||||||||||||||||||||||||||||||||||||||||
| 175 | 0 | return { map { $$_ = ref($self)."::EVERY::".$wanted_method; | |||||||||||||||||||||||||||||||||||||||||
| 176 | 0 | ($_, scalar($self->$_(@_[1..$#_]))) | |||||||||||||||||||||||||||||||||||||||||
| 177 | } @every | ||||||||||||||||||||||||||||||||||||||||||
| 178 | }; | ||||||||||||||||||||||||||||||||||||||||||
| 179 | } | ||||||||||||||||||||||||||||||||||||||||||
| 180 | else { | ||||||||||||||||||||||||||||||||||||||||||
| 181 | 0 | for (@every) { | |||||||||||||||||||||||||||||||||||||||||
| 182 | 0 | $$_ = ref($self)."::EVERY::".$wanted_method; | |||||||||||||||||||||||||||||||||||||||||
| 183 | 0 | $self->$_(@_[1..$#_]); | |||||||||||||||||||||||||||||||||||||||||
| 184 | } | ||||||||||||||||||||||||||||||||||||||||||
| 185 | 0 | return; | |||||||||||||||||||||||||||||||||||||||||
| 186 | } | ||||||||||||||||||||||||||||||||||||||||||
| 187 | 12 | }; | |||||||||||||||||||||||||||||||||||||||||
| 188 | } | ||||||||||||||||||||||||||||||||||||||||||
| 189 | |||||||||||||||||||||||||||||||||||||||||||
| 190 | 6 | package EVERY::LAST; @ISA = 'EVERY'; EVERY::ELSEWHERE::buildAUTOLOAD(); | |||||||||||||||||||||||||||||||||||||||||
| 191 | package | ||||||||||||||||||||||||||||||||||||||||||
| 192 | 6 | EVERY; @ISA = 'NEXT'; EVERY::ELSEWHERE::buildAUTOLOAD(); | |||||||||||||||||||||||||||||||||||||||||
| 193 | |||||||||||||||||||||||||||||||||||||||||||
| 194 | 6 | 1; | |||||||||||||||||||||||||||||||||||||||||
| 195 | |||||||||||||||||||||||||||||||||||||||||||
| 196 | __END__ | ||||||||||||||||||||||||||||||||||||||||||