| 1 | package Data::Printer::Filter::REF; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 2 | 35 | ▶ | use strict; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 3 | 35 | ▶ | use warnings; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 4 | 35 | ▶ | use Data::Printer::Filter; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 5 | 35 | ▶ | use Scalar::Util (); | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 6 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 7 | 35 | filter 'REF' => \&parse; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 8 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 9 | 65 | ▶ | sub parse { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Subroutine
parse: called CC=7 SCAR=19.8
Pod
undocumented
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 10 | 65 | my ($ref, $ddp) = @_; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 11 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 12 | 65 | my $string = ''; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 13 | # we only add the '\' if it's not an object | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 14 | 65 | ▶ | if (!Scalar::Util::blessed($$ref) && (ref $$ref eq 'REF' || ref $$ref eq 'SCALAR' || ref $$ref eq 'VSTRING')) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition88%8/9
not builtin::blessed($$ref) and ref $$ref eq "REF" || ref $$ref eq "SCALAR" || ref $$ref eq "VSTRING"
ref $$ref eq "REF" or ref $$ref eq "SCALAR" or ref $$ref eq "VSTRING"
ref $$ref eq "REF" or ref $$ref eq "SCALAR"
MC/DC75%3/4
not builtin::blessed($$ref) and ref $$ref eq "REF" || ref $$ref eq "SCALAR" || ref $$ref eq "VSTRING"
not builtin::blessed($$ref)
ref $$ref eq "REF"
ref $$ref eq "SCALAR"
ref $$ref eq "VSTRING"
Truth table80%4/5
not(A) and B or C or D
A= not builtin::blessed($$ref)B= ref $$ref eq "REF"C= ref $$ref eq "SCALAR"D= ref $$ref eq "VSTRING"
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 15 | 24 | $string .= '\\ '; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 16 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 17 | 65 | $string .= $ddp->parse($$ref); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 18 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 19 | 65 | ▶ | if ($ddp->show_tied and my $tie = ref tied $ref) { | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$ddp->show_tied and my $tie = ref tied $ref
MC/DC0%0/2
$ddp->show_tied and my $tie = ref tied $ref
$ddp->show_tied
my $tie = ref tied $ref
Truth table66%2/3
A and B
A= $ddp->show_tiedB= my $tie = ref tied $ref
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 20 | 0 | $string .= " (tied to $tie)"; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 21 | } | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 22 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 23 | 65 | return $string; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 24 | }; | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 25 | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 26 | 35 | 1; | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||