lib/Perlmazing/Perlmazing/fout.pm

filter: Statementstmt 100% 18 / 18 Branchbran 50.0% 4 / 8 Conditioncond 33.3% 1 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 100% 3 / 3 Podpod 0.0% 0 / 1 totaltotal 74.2% 26 / 35 CC 6 SCAR 16.3
CC
6
Cov
79%
main
6.4
BEGIN
1.0
BEGIN
1.0
CRAP 5.1
« lib/Perlmazing/Perlmazing/slurp.pm ↑ Summary lib/Perlmazing/Perlmazing/Precompile/in_array.pm »
1 1 ▶use Perlmazing qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
2  
3 1 ▶sub main {
Subroutine main: called CC=6 SCAR=18.6
Pod undocumented
4 1 my $filename = shift;
5 1 my $data = shift;
6 1 my $binmode = shift;
7 1 my $encoding;
8 {
9 1 ▶ no warnings 'numeric';
Subroutine BEGIN: called CC=1 SCAR=0.0
10 1 ▶ if ($binmode and ($binmode + 0) ne '1') {
Branch: 1 branch
BranchTrueFalseTotal
if ($binmode and $binmode + 0 ne 1) 1 0 1
Condition33%1/3
$binmode and $binmode + 0 ne 1
!ll&&!rl&&r
001
MC/DC0%0/2
$binmode and $binmode + 0 ne 1
$binmode $binmode + 0 ne 1
Truth table33%1/3
A and B
A= $binmodeB= $binmode + 0 ne 1
ABresult
0X0
100
111
11 1 $encoding = $binmode;
12 1 undef $binmode;
13 }
14 }
15 1 ▶ open my $out, '>'.($encoding ? ":encoding($encoding)" : ''), $filename or croak "Cannot write to $filename: $!";
Branch: 2 branches
BranchTrueFalseTotal
open my $out, '>' . ($encoding ? ":encoding($encoding)" : ""), $filename or croak("Cannot write to ${filename}: $!") 1 0 1
$encoding ? : 1 0 1
16 1 ▶ binmode($out) if $binmode;
Branch: 1 branch
BranchTrueFalseTotal
if $binmode 0 1 1
17 1 print $out $data;
18 1 close $out;
19 }
20  
21 1;
« lib/Perlmazing/Perlmazing/slurp.pm ↑ Summary lib/Perlmazing/Perlmazing/Precompile/in_array.pm »