| line |
true |
false |
branch |
|
64
|
0 |
28 |
unless open my $in, '<:raw', $filename |
|
69
|
4 |
24 |
unless (defined $encoding) |
|
70
|
0 |
4 |
unless defined($encoding = $default_encoding) |
|
72
|
0 |
4 |
if $options->{'encoding'} |
|
76
|
6 |
22 |
$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
|
28 |
28 |
unless defined $filename |
|
113
|
0 |
56 |
if $pos < 0 |
|
115
|
0 |
56 |
unless defined read($in, my $buf, $bytes_to_check) |
|
118
|
0 |
56 |
unless seek $in, $pos, 0 |
|
124
|
4 |
52 |
if ($buf =~ /^\xFe\xFF/) { } |
|
|
8 |
44 |
elsif ($buf =~ /^\xFF\xFe/) { } |
|
|
4 |
40 |
elsif ($buf =~ /^\xEF\xBB\xBF/) { } |
|
138
|
16 |
40 |
if ($bom) { } |
|
|
20 |
20 |
elsif (not defined $encoding) { } |
|
139
|
0 |
16 |
unless seek $in, $bom, 1 |
|
144
|
12 |
8 |
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 |
39 |
if (defined $encoding and $options->{'encoding'} and not ref $encoding) |
|
157
|
56 |
0 |
wantarray ? : |
|
168
|
151 |
69 |
if /\G>/cg or not /\G(=?[^\x09\x0A\x0C\x0D =]*)/cg |
|
172
|
12 |
0 |
if (/\G[\x09\x0A\x0C\x0D ]*=[\x09\x0A\x0C\x0D ]*/cg and /\G"([^"]*)"?/cg || /\G'([^']*)'?/cg || /\G([^\x09\x0A\x0C\x0D >]*)/cg) |
|
179
|
67 |
2 |
wantarray ? : |
|
187
|
16 |
0 |
if /\G"([^"]*)"/cg or /\G'([^']*)'/cg or /\G(?!['"])([^\x09\x0A\x0C\x0D ;]+)/cg |
|
203
|
0 |
62 |
length $_ > $bytes_to_check ? : |
|
206
|
13 |
49 |
defined $options->{'need_pragma'} ? : |
|
210
|
7 |
151 |
if (/\G |