blib/lib/File/Edit/Portable.pm

filter: Statementstmt 99.5% 238 / 239 Branchbran 87.0% 94 / 108 Conditioncond 92.5% 25 / 27 MC/DCmcdc 88.2% 15 / 17 Subroutinesub 96.4% 27 / 28 Podpod 100% 8 / 8 totaltotal 95.3% 407 / 427 CC 71 SCAR 21.8
CC
71
Cov
95%
write
17.0
splice
16.0
recsep
8.0
CRAP 8.8
↑ Summary
1 package File::Edit::Portable;
2 17 ▶use 5.008;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 17 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 17 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 0 ▶$SIG{__WARN__} = sub { confess(shift); };
Subroutine __ANON__: not called CC=1 SCAR=1.2
7 17 our $VERSION = '1.24';
8  
9 17 ▶use Carp;
Subroutine BEGIN: called CC=1 SCAR=0.0
10 17 ▶use Exporter;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 17 ▶use Fcntl qw(:flock);
Subroutine BEGIN: called CC=1 SCAR=0.0
12 17 ▶use File::Find::Rule;
Subroutine BEGIN: called CC=1 SCAR=0.0
13 17 ▶use File::Temp;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 17 ▶use POSIX qw(uname);
Subroutine BEGIN: called CC=1 SCAR=0.0
15  
16 17 our @ISA = qw(Exporter);
17 17 our @EXPORT_OK = qw(
18 recsep
19 platform_recsep
20 );
21  
22 sub new {
23 60 ▶ return bless {}, shift;
Subroutine new: called CC=1 SCAR=0.0
Pod documented
24 }
25 sub read {
26 112 ▶ my $self = shift;
Subroutine read: called CC=8 SCAR=20.8
Pod documented
27 112 my ($file, $testing);
28  
29 112 ▶ if ($_[0] eq 'file'){
Branch: 1 branch
BranchTrueFalseTotal
if ($_[0] eq 'file') { } 8 104 112
30 8 $self->_config(@_);
31 }
32 else {
33 104 $file = shift;
34 104 ▶ $testing = shift if @_;
Branch: 1 branch
BranchTrueFalseTotal
if @_ 2 102 104
35 104 $self->_config(file => $file, testing => $testing);
36 }
37  
38 112 $file = $self->{file};
39 112 $testing = $self->{testing};
40  
41 112 ▶ if (! $file){
Branch: 1 branch
BranchTrueFalseTotal
unless ($file) 1 111 112
42 1 confess "read() requires a file name sent in!";
43 }
44  
45 111 $self->recsep($file);
46 111 $self->{files}{$file}{is_read} = 1;
47 111 $self->{files}{$file}{recsep} = $self->{recsep};
48 111 $self->{reads}{count} = keys %{ $self->{files} };
49  
50 111 my $fh;
51  
52 111 ▶ if (! wantarray){
Branch: 1 branch
BranchTrueFalseTotal
if (not wantarray) { } 54 57 111
53 54 $fh = $self->_handle($file);
54 54 return $fh;
55 }
56 else {
57 57 $fh = $self->_binmode_handle($file);
58 57 my @contents = <$fh>;
59 57 ▶ close $fh or confess "read() can't close file $file!: $!";
Branch: 1 branch
BranchTrueFalseTotal
close $fh or confess("read() can't close file $file!: $!") 0 57 57
60  
61 57 ▶ if (! $testing){
Branch: 1 branch
BranchTrueFalseTotal
unless ($testing) 55 2 57
62 55 for (@contents){
63 474 $_ = $self->_strip_ends($_);
64 }
65 }
66 57 return @contents;
67 }
68 }
69 sub write {
70 76 ▶ my $self = shift;
Subroutine write: called CC=17 SCAR=28.3
Pod documented
71 76 my %p = @_;
72 76 $self->_config(%p);
73  
74 76 ▶ if (! $self->{file}){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"file"}) 2 74 76
75 2 confess "write() requires a file to be passed in!";
76 }
77  
78 74 ▶ my $reads_count = $self->{reads}{count} || 0;
Condition100%2/2
$self->{'reads'}{'count'} || 0
l!l
695
MC/DC100%1/1
$self->{'reads'}{'count'} || 0
$self->{'reads'}{'count'}
Truth table100%2/2
A
A= $self->{'reads'}{'count'}
Aresult
11
00
79  
80 74 ▶ if ($reads_count > 1 && ! $p{file}){
Branch: 1 branch
BranchTrueFalseTotal
if ($reads_count > 1 and not $p{"file"}) 2 72 74
Condition100%3/3
$reads_count > 1 and not $p{"file"}
!ll&&!rl&&r
54182
MC/DC100%2/2
$reads_count > 1 and not $p{"file"}
$reads_count > 1 not $p{"file"}
Truth table100%3/3
A and not(B)
A= $reads_count > 1B= not $p{"file"}
ABresult
0X0
100
111
81 confess "\nif calling write() with more than one read() open, you must " .
82 "send in a file name with the 'file' parameter so we know " .
83 "which file to write. You currently have the following files " .
84 2 "open: " . join(' ', keys %{ $self->{files} }) . "\n";
85 }
86 72 ▶ if (! $self->{contents}){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"contents"}) 1 71 72
87 1 confess "write() requires 'contents' param sent in";
88 }
89  
90 71 my $file = $self->{file}; # needed for cleanup of open file list
91  
92 71 ▶ if (! $self->{files}{$file}{is_read}){
Branch: 1 branch
BranchTrueFalseTotal
unless ($self->{"files"}{$file}{"is_read"}) 6 65 71
93 6 $self->{files}{$file}{recsep} = $self->recsep($file);
94 }
95  
96 71 ▶ $self->{file} = $self->{copy} if $self->{copy};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"copy"} 45 26 71
97  
98 71 my $wfh = $self->_binmode_handle($self->{file}, 'w');
99  
100 # certain FreeBSD versions on amd64 don't work
101 # with flock()
102  
103 71 my @os = uname();
104  
105 71 ▶ unless ($os[0] eq 'FreeBSD' && $os[-1] eq 'amd64'){
Branch: 1 branch
BranchTrueFalseTotal
unless ($os[0] eq "FreeBSD" and $os[-1] eq "amd64") 71 0 71
Condition33%1/3
$os[0] eq "FreeBSD" and $os[-1] eq "amd64"
!ll&&!rl&&r
7100
MC/DC0%0/2
$os[0] eq "FreeBSD" and $os[-1] eq "amd64"
$os[0] eq "FreeBSD" $os[-1] eq "amd64"
Truth table33%1/3
A and B
A= $os[0] eq "FreeBSD"B= $os[-1] eq "amd64"
ABresult
0X0
100
111
106 71 flock $wfh, LOCK_EX;
107 }
108  
109 my $recsep = defined $self->{custom_recsep}
110 ? $self->{custom_recsep}
111 71 ▶ : $self->{files}{$file}{recsep};
Branch: 1 branch
BranchTrueFalseTotal
defined $self->{'custom_recsep'} ? : 32 39 71
112  
113 71 my $contents = $self->{contents};
114  
115 71 ▶ if (ref($contents) eq 'GLOB' || ref($contents) eq 'File::Temp') {
Branch: 1 branch
BranchTrueFalseTotal
if (ref $contents eq 'GLOB' or ref $contents eq 'File::Temp') { } 49 22 71
Condition100%3/3
ref $contents eq "GLOB" or ref $contents eq "File::Temp"
l!l&&r!l&&!r
242522
MC/DC100%2/2
ref $contents eq "GLOB" or ref $contents eq "File::Temp"
ref $contents eq "GLOB" ref $contents eq "File::Temp"
Truth table100%3/3
A or B
A= ref $contents eq "GLOB"B= ref $contents eq "File::Temp"
ABresult
1X1
011
000
116 {
117 49 my $warn;
118 49 ▶ local $SIG{__WARN__} = sub { $warn = shift; };
Subroutine __ANON__: called CC=1 SCAR=0.0
119  
120 49 seek $contents, 0, 0;
121  
122 49 ▶ if ($warn) {
Branch: 1 branch
BranchTrueFalseTotal
if ($warn) 1 48 49
123 1 confess "\nthe file handle you're passing into write() as ".
124 "the contents param has already been closed\n";
125 }
126  
127 };
128  
129 48 ▶ while (<$contents>){
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline $contents)) 221 48 269
130 221 $_ = $self->_strip_ends($_);
131 221 print $wfh $_ . $recsep;
132 }
133 48 close $contents;
134 }
135 else {
136 22 for (@$contents){
137 250 $_ = $self->_strip_ends($_);
138 250 print $wfh $_ . $recsep;
139 }
140 }
141  
142 70 close $wfh;
143 70 delete $self->{files}{$file}; # cleanup open list
144 70 ▶ $self->{reads}{count} = 0 if keys %{ $self->{files} } == 0;
Branch: 1 branch
BranchTrueFalseTotal
if keys %{$$self{"files"};} == 0 55 15 70
145  
146 70 return 1;
147 }
148 sub splice {
149 17 ▶ my $self = shift;
Subroutine splice: called CC=16 SCAR=27.7
Pod documented
150 17 $self->_config(@_);
151  
152 17 my $file = $self->{file};
153 17 my $copy = $self->{copy};
154 17 my $insert = $self->{insert};
155 17 ▶ my $limit = defined $self->{limit} ? $self->{limit} : 1;
Branch: 1 branch
BranchTrueFalseTotal
defined $self->{'limit'} ? : 5 12 17
156  
157 17 ▶ if (! $insert){
Branch: 1 branch
BranchTrueFalseTotal
unless ($insert) 1 16 17
158 1 confess "splice() requires insert => [aref] param";
159 }
160  
161 16 my ($line, $find) = ($self->{line}, $self->{find});
162  
163 16 ▶ if (! defined $line && ! defined $find){
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $line or defined $find) 1 15 16
Condition100%3/3
defined $line or defined $find
l!l&&r!l&&!r
4111
MC/DC100%2/2
defined $line or defined $find
defined $line defined $find
Truth table100%3/3
A or B
A= defined $lineB= defined $find
ABresult
1X1
011
000
164 1 confess
165 "splice() requires either the 'line' or 'find' parameter sent in.";
166 }
167  
168 15 ▶ if (defined $line && defined $find){
Branch: 1 branch
BranchTrueFalseTotal
if (defined $line and defined $find) 1 14 15
Condition100%3/3
defined $line and defined $find
!ll&&!rl&&r
1131
MC/DC100%2/2
defined $line and defined $find
defined $line defined $find
Truth table100%3/3
A and B
A= defined $lineB= defined $find
ABresult
0X0
100
111
169 1 warn
170 "splice() can't search for both line and find. Operating on 'line'.";
171 }
172  
173 15 my @contents = $self->read($file);
174  
175 14 ▶ if (defined $line){
Branch: 1 branch
BranchTrueFalseTotal
if (defined $line) 4 10 14
176 4 ▶ if ($line !~ /^[0-9]+$/){
Branch: 1 branch
BranchTrueFalseTotal
unless ($line =~ /^[0-9]+$/) 1 3 4
177 1 confess "splice() requires its 'line' param to contain only an " .
178 "integer. You supplied: $line\n";
179 }
180 3 splice @contents, $line, 0, @$insert;
181 }
182  
183 13 ▶ if (defined $find && ! defined $line){
Branch: 1 branch
BranchTrueFalseTotal
if (defined $find and not defined $line) 10 3 13
Condition100%3/3
defined $find and not defined $line
!ll&&!rl&&r
2110
MC/DC100%2/2
defined $find and not defined $line
defined $find not defined $line
Truth table100%3/3
A and not(B)
A= defined $findB= not defined $line
ABresult
0X0
100
111
184 10 ▶ $find = qr{$find} if ! ref $find ne 'Regexp';
Branch: 1 branch
BranchTrueFalseTotal
if !ref($find) ne "Regexp" 10 0 10
185  
186 10 my $i = 0;
187 10 my $inserts = 0;
188  
189 10 for (@contents){
190 75 $i++;
191 75 ▶ if (/$find/){
Branch: 1 branch
BranchTrueFalseTotal
if (/$find/) 21 54 75
192 21 $inserts++;
193 21 splice @contents, $i, 0, @$insert;
194 21 ▶ if ($limit){
Branch: 1 branch
BranchTrueFalseTotal
if ($limit) 17 4 21
195 17 ▶ last if $inserts == $limit;
Branch: 1 branch
BranchTrueFalseTotal
if $inserts == $limit 9 8 17
196 }
197 }
198 }
199 }
200  
201 13 $self->write(contents => \@contents, copy => $copy);
202  
203 13 return @contents;
204 }
205 sub dir {
206 18 ▶ my $self = shift;
Subroutine dir: called CC=7 SCAR=19.5
Pod documented
207 18 $self->_config(@_);
208  
209 18 my $recsep = $self->{custom_recsep};
210  
211 18 my @types;
212  
213 18 ▶ if ($self->{types}){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{'types'}) { } 8 10 18
214 8 @types = @{ $self->{types} };
215 }
216 else {
217 10 @types = qw(*);
218 }
219  
220 18 my $find = File::Find::Rule->new;
221
222 18 ▶ $find->maxdepth($self->{maxdepth}) if $self->{maxdepth};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"maxdepth"} 6 12 18
223 18 $find->file;
224 18 $find->name(@types);
225  
226 18 my @files = $find->in($self->{dir});
227  
228 18 ▶ return @files if $self->{list};
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"list"} 8 10 18
229  
230 10 for my $file (@files){
231  
232 23 my $fh = $self->read($file);
233 23 my $wfh = $self->tempfile;
234  
235 23 ▶ while(<$fh>){
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline $fh)) 69 23 92
236 69 print $wfh $_;
237 }
238 23 close $fh;
239  
240 23 ▶ $self->write(
Branch: 1 branch
BranchTrueFalseTotal
defined $recsep ? : 14 9 23
241 file => $file,
242 contents => $wfh,
243 recsep => defined $recsep
244 ? $recsep
245 : $self->platform_recsep,
246 );
247 }
248  
249 10 return @files;
250 }
251 sub recsep {
252 226 ▶ my $self = ref $_[0] eq __PACKAGE__
Subroutine recsep: called CC=8 SCAR=20.8
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] eq __PACKAGE__ ? : 221 5 226
253 ? shift
254 : __PACKAGE__->new;
255  
256 226 my $file = shift;
257 226 my $want = shift;
258  
259 226 my $fh;
260 226 eval {
261 226 $fh = $self->_binmode_handle($file);
262 };
263  
264 226 ▶ if ($@ || -z $fh){
Branch: 1 branch
BranchTrueFalseTotal
if ($@ or -z $fh) 9 217 226
Condition100%3/3
$@ or -z $fh
l!l&&r!l&&!r
63217
MC/DC100%2/2
$@ or -z $fh
$@ -z $fh
Truth table100%3/3
A or B
A= $@B= -z $fh
ABresult
1X1
011
000
265  
266 # we've got an empty file...
267 # we'll set recsep to the local platform's
268  
269 9 $self->{recsep} = $self->platform_recsep;
270  
271 return $want
272 ? $self->_convert_recsep($self->{recsep}, $want)
273 9 ▶ : $self->{recsep};
Branch: 1 branch
BranchTrueFalseTotal
$want ? : 4 5 9
274 }
275  
276 217 seek $fh, 0, 0;
277  
278 217 my $recsep_regex = $self->_recsep_regex;
279  
280 217 ▶ if (<$fh> =~ /$recsep_regex/){
Branch: 1 branch
BranchTrueFalseTotal
if (readline($fh) =~ /$recsep_regex/) 217 0 217
281 217 $self->{recsep} = $1;
282 }
283  
284 217 ▶ close $fh or confess "recsep() can't close file $file!: $!";
Branch: 1 branch
BranchTrueFalseTotal
close $fh or confess("recsep() can't close file $file!: $!") 0 217 217
285  
286 return $want
287 ? $self->_convert_recsep($self->{recsep}, $want)
288 217 ▶ : $self->{recsep};
Branch: 1 branch
BranchTrueFalseTotal
$want ? : 105 112 217
289 }
290 sub platform_recsep {
291 183 ▶ my $self = ref $_[0] eq __PACKAGE__
Subroutine platform_recsep: called CC=7 SCAR=20.1
Pod documented
Branch: 1 branch
BranchTrueFalseTotal
ref $_[0] eq __PACKAGE__ ? : 183 0 183
292 ? shift
293 : __PACKAGE__->new;
294  
295 183 my $want = shift;
296  
297 183 my $file = $self->_temp_filename;
298  
299 # for platform_recsep(), we need the file open in ASCII mode,
300 # so we can't use _binmode_handle() or File::Temp
301  
302 183 ▶ open my $wfh, '>', $file
Branch: 1 branch
BranchTrueFalseTotal
open my $wfh, ">", $file or confess("platform_recsep() can't open temp file $file for writing!: $!") 0 183 183
303 or confess
304 "platform_recsep() can't open temp file $file for writing!: $!";
305  
306 183 print $wfh "abc\n";
307  
308 183 ▶ close $wfh
Branch: 1 branch
BranchTrueFalseTotal
close $wfh or confess("platform_recsep() can't close write temp file ${file}: $!") 0 183 183
309 or confess "platform_recsep() can't close write temp file $file: $!";
310  
311 183 my $fh = $self->_binmode_handle($file);
312  
313 183 my $recsep_regex = $self->_recsep_regex;
314  
315 183 ▶ if (<$fh> =~ /$recsep_regex/){
Branch: 1 branch
BranchTrueFalseTotal
if (readline($fh) =~ /$recsep_regex/) 183 0 183
316 183 $self->{platform_recsep} = $1;
317 }
318  
319 183 ▶ close $fh
Branch: 1 branch
BranchTrueFalseTotal
close $fh or confess("platform_recsep() can't close temp file $file after run: $!") 0 183 183
320 or confess "platform_recsep() can't close temp file $file after run: $!";
321  
322 return $want
323 ? $self->_convert_recsep($self->{platform_recsep}, $want)
324 183 ▶ : $self->{platform_recsep};
Branch: 1 branch
BranchTrueFalseTotal
$want ? : 58 125 183
325 }
326 sub tempfile {
327 # returns a temporary file handle in write mode
328  
329 41 ▶ my $wfh = File::Temp->new(UNLINK => 1);
Subroutine tempfile: called CC=1 SCAR=0.0
Pod documented
330 41 return $wfh;
331 }
332 sub _config {
333 # configures self with incoming params
334  
335 223 ▶ my $self = shift;
Subroutine _config: called CC=3 SCAR=11.0
336 223 my %p = @_;
337  
338 223 $self->{custom_recsep} = $p{recsep};
339 223 delete $p{recsep};
340  
341 223 my @params = qw(
342 testing copy types list maxdepth
343 insert line find limit
344 );
345  
346 223 for (@params){
347 2007 delete $self->{$_};
348 }
349
350 223 for (keys %p){
351 489 $self->{$_} = $p{$_};
352 }
353 }
354 sub _handle {
355 # returns a handle with platform's record separator
356  
357 54 ▶ my $self = shift;
Subroutine _handle: called CC=5 SCAR=16.1
358 54 my $file = shift;
359
360 54 my $fh;
361  
362 54 ▶ if ($self->recsep($file, 'hex') ne $self->platform_recsep('hex')){
Branch: 1 branch
BranchTrueFalseTotal
if ($self->recsep($file, 'hex') ne $self->platform_recsep('hex')) { } 16 38 54
363
364 16 $fh = $self->_binmode_handle($file);
365 16 my $temp_wfh = $self->tempfile;
366 16 binmode $temp_wfh, ':raw';
367  
368 16 my $temp_filename = $temp_wfh->filename;
369  
370 16 ▶ while (<$fh>){
Branch: 1 branch
BranchTrueFalseTotal
if (defined($_ = readline $fh)) 92 16 108
371 92 $_ = $self->_platform_replace($_);
372 92 print $temp_wfh $_;
373 }
374
375 16 ▶ close $fh or confess "can't close file $file: $!";
Branch: 1 branch
BranchTrueFalseTotal
close $fh or confess("can't close file ${file}: $!") 0 16 16
376 16 ▶ close $temp_wfh or confess "can't close file $temp_filename: $!";
Branch: 1 branch
BranchTrueFalseTotal
close $temp_wfh or confess("can't close file ${temp_filename}: $!") 0 16 16
377  
378 16 my $ret_fh = $self->_binmode_handle($temp_filename);
379
380 16 return $ret_fh;
381 }
382 else {
383 38 $fh = $self->_binmode_handle($file);
384 38 return $fh;
385 }
386 }
387 sub _binmode_handle {
388 # returns a handle opened with binmode :raw
389  
390 608 ▶ my $self = shift;
Subroutine _binmode_handle: called CC=5 SCAR=16.1
391 608 my $file = shift;
392 608 ▶ my $mode = shift || 'r';
Condition100%2/2
shift() || 'r'
l!l
71537
MC/DC100%1/1
shift() || 'r'
shift()
Truth table100%2/2
A
A= shift()
Aresult
11
00
393  
394 608 my $fh;
395  
396 608 ▶ if ($mode =~ /^w/){
Branch: 1 branch
BranchTrueFalseTotal
if ($mode =~ /^w/) { } 71 537 608
397 71 ▶ open $fh, '>', $file
Branch: 1 branch
BranchTrueFalseTotal
open $fh, ">", $file or confess("_binmode_handle() can't open file $file for writing!: $!") 0 71 71
398 or confess "_binmode_handle() can't open file $file for writing!: $!";
399 }
400 else {
401 537 ▶ open $fh, '<', $file
Branch: 1 branch
BranchTrueFalseTotal
open $fh, "<", $file or confess("_binmode_handle() can't open file $file for reading!: $!") 7 530 537
402 or confess "_binmode_handle() can't open file $file for reading!: $!";
403 }
404  
405 601 binmode $fh, ':raw';
406  
407 601 return $fh;
408 }
409 sub _convert_recsep {
410 # converts recsep to either hex or OS name (ie. type)
411  
412 175 ▶ my ($self, $sep, $want) = @_;
Subroutine _convert_recsep: called CC=3 SCAR=11.0
413  
414 175 $sep = unpack "H*", $sep;
415 175 $sep =~ s/0/\\0/g;
416  
417 175 ▶ return $sep if $want eq 'hex';
Branch: 1 branch
BranchTrueFalseTotal
if $want eq "hex" 152 23 175
418  
419 23 my %seps = (
420 '\0a' => 'nix',
421 '\0d\0a' => 'win',
422 '\0d' => 'mac',
423 );
424  
425 23 ▶ return $seps{$sep} || 'unknown';
Condition100%2/2
$seps{$sep} || 'unknown'
l!l
221
MC/DC100%1/1
$seps{$sep} || 'unknown'
$seps{$sep}
Truth table100%2/2
A
A= $seps{$sep}
Aresult
11
00
426 }
427 sub _recsep_regex {
428 # returns a regex object representing all recseps
429 1437 ▶ return qr/([\n\x{0B}\f\r\x{85}]{1,2})/;
Subroutine _recsep_regex: called CC=1 SCAR=0.0
430 }
431 sub _platform_replace {
432 # replace recseps in a string with the platform recsep
433  
434 92 ▶ my ($self, $str) = @_;
Subroutine _platform_replace: called CC=1 SCAR=0.0
435 92 my $re = $self->_recsep_regex;
436 92 $str =~ s/$re/$self->platform_recsep/ge;
437 92 return $str;
438 }
439 sub _strip_ends {
440 # strip all line endings from string
441  
442 945 ▶ my ($self, $str) = @_;
Subroutine _strip_ends: called CC=1 SCAR=0.0
443 945 my $re = $self->_recsep_regex;
444 945 $str =~ s/$re//g;
445 945 return $str;
446 }
447 sub _temp_filename {
448 # return the name of a temporary file
449  
450 186 ▶ my $temp_fh = File::Temp->new(UNLINK => 1);
Subroutine _temp_filename: called CC=2 SCAR=7.0
451 186 my $filename = $temp_fh->filename;
452  
453 186 ▶ close $temp_fh
Branch: 1 branch
BranchTrueFalseTotal
close $temp_fh or confess("_temp_filename() can't close the $filename temp file: $!") 0 186 186
454 or confess "_temp_filename() can't close the $filename temp file: $!";
455  
456 186 return $filename;
457 }
458 1 ▶sub _vim_placeholder { return 1; }; # for folding
Subroutine _vim_placeholder: called CC=1 SCAR=0.0
459  
460 17 1;
461 __END__
↑ Summary