| 1 | 2 | ▶ | use Perlmazing qw(croak); | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 2 | |||||||||||||||||||||||||||||
| 3 | 3 | ▶ | sub main { | ||||||||||||||||||||||||||
|
Subroutine
main: called CC=8 SCAR=21.0
Pod
undocumented
| |||||||||||||||||||||||||||||
| 4 | 3 | my $file = shift; | |||||||||||||||||||||||||||
| 5 | 3 | my $binary = shift; | |||||||||||||||||||||||||||
| 6 | 3 | my $encoding; | |||||||||||||||||||||||||||
| 7 | { | ||||||||||||||||||||||||||||
| 8 | 2 | ▶ | no warnings 'numeric'; | ||||||||||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||||||||||
| 9 | 3 | ▶ | if ($binary and ($binary + 0) == 0) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition66%2/3
$binary and $binary + 0 == 0
MC/DC50%1/2
$binary and $binary + 0 == 0
$binary
$binary + 0 == 0
Truth table66%2/3
A and B
A= $binaryB= $binary + 0 == 0
| |||||||||||||||||||||||||||||
| 10 | 1 | $encoding = $binary; | |||||||||||||||||||||||||||
| 11 | 1 | undef $binary; | |||||||||||||||||||||||||||
| 12 | } | ||||||||||||||||||||||||||||
| 13 | } | ||||||||||||||||||||||||||||
| 14 | 3 | ▶ | croak "File '$file' cannot be read: $!" unless open my $in, '<'.($encoding ? ":encoding($encoding)" : ''), $file; | ||||||||||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||||||||||
| 15 | 3 | ▶ | binmode $in if -B $file or $binary; | ||||||||||||||||||||||||||
|
Branch: 1 branch
Condition33%1/3
-B $file or $binary
MC/DC0%0/2
-B $file or $binary
-B $file
$binary
Truth table33%1/3
A or B
A= -B $fileB= $binary
| |||||||||||||||||||||||||||||
| 16 | 3 | ▶ | if (wantarray) { | ||||||||||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||||||||||
| 17 | 2 | my @data = <$in>; | |||||||||||||||||||||||||||
| 18 | 2 | close $in; | |||||||||||||||||||||||||||
| 19 | 2 | return @data; | |||||||||||||||||||||||||||
| 20 | } else { | ||||||||||||||||||||||||||||
| 21 | 1 | local $/ = undef; | |||||||||||||||||||||||||||
| 22 | 1 | my $data = <$in>; | |||||||||||||||||||||||||||
| 23 | 1 | close $in; | |||||||||||||||||||||||||||
| 24 | 1 | return $data; | |||||||||||||||||||||||||||
| 25 | } | ||||||||||||||||||||||||||||
| 26 | } | ||||||||||||||||||||||||||||
| 27 | |||||||||||||||||||||||||||||
| 28 | 1; | ||||||||||||||||||||||||||||