line |
true |
false |
branch |
64
|
0 |
36 |
unless open my $in, '<:raw', $filename |
69
|
8 |
28 |
unless (defined $encoding) |
70
|
0 |
8 |
unless defined($encoding = $default_encoding) |
72
|
0 |
8 |
if $options->{'encoding'} |
76
|
6 |
30 |
$options->{'encoding'} ? : |
87
|
0 |
6 |
if (not defined $encoding) { } |
|
1 |
5 |
elsif (ref $encoding) { } |
88
|
0 |
0 |
unless defined($encoding = $default_encoding) |
95
|
0 |
6 |
unless open my $out, ">:encoding($encoding)", $filename |
98
|
3 |
3 |
if $bom |
109
|
36 |
36 |
unless defined $filename |
113
|
0 |
72 |
if $pos < 0 |
115
|
0 |
72 |
unless defined read($in, my $buf, $bytes_to_check) |
118
|
0 |
72 |
unless seek $in, $pos, 0 |
124
|
4 |
68 |
if ($buf =~ /^\xFe\xFF/) { } |
|
8 |
60 |
elsif ($buf =~ /^\xFF\xFe/) { } |
|
4 |
56 |
elsif ($buf =~ /^\xEF\xBB\xBF/) { } |
138
|
16 |
56 |
if ($bom) { } |
|
28 |
28 |
elsif (not defined $encoding) { } |
139
|
0 |
16 |
unless seek $in, $bom, 1 |
144
|
12 |
16 |
if ($buf =~ /^(?: # nothing left over
| [\xC2-\xDF] # incomplete 2-byte char
| [\xE0-\xEF] [\x80-\xBF]? # incomplete 3-byte char
| [\xF0-\xF4] [\x80-\xBF]{0,2} # incomplete 4-byte char
)\z/x and $test =~ /[^\x00-\x7F]/) |
153
|
9 |
47 |
if (defined $encoding and $options->{'encoding'} and not ref $encoding) |
157
|
72 |
0 |
wantarray ? : |
168
|
192 |
94 |
if /\G>/cg or not /\G(=?[^\x09\x0A\x0C\x0D =]*)/cg |
172
|
84 |
10 |
if (/\G[\x09\x0A\x0C\x0D ]*=[\x09\x0A\x0C\x0D ]*/cg) |
173
|
72 |
12 |
if (/\G"/cg) { } |
|
0 |
12 |
elsif (/\G'/cg) { } |
176
|
9 |
63 |
unless $2 |
181
|
0 |
0 |
unless $2 |
190
|
85 |
0 |
wantarray ? : |
198
|
16 |
0 |
if /\G"([^"]*)"/cg or /\G'([^']*)'/cg or /\G(?!['"])([^\x09\x0A\x0C\x0D ;]+)/cg |
214
|
3 |
78 |
length $_ > $bytes_to_check ? : |
217
|
13 |
68 |
defined $options->{'need_pragma'} ? : |
221
|
7 |
204 |
if (/\G |