This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
don't leak temp files
authorTony Cook <tony@develop-help.com>
Mon, 28 Jan 2019 03:11:50 +0000 (14:11 +1100)
committerTony Cook <tony@develop-help.com>
Mon, 28 Jan 2019 04:28:05 +0000 (15:28 +1100)
the test I added allocated more temp files, but didn't arrange for
backup files to be cleaned up.

Modified the cleanup to clean up every generated temp and backup file
even if more are allocated in the future with mkfiles()

t/io/nargv.t

index 4482572..a62c4f2 100644 (file)
@@ -137,4 +137,4 @@ sub mkfiles {
     return wantarray ? @results : @results[-1];
 }
 
-END { unlink_all map { ($_, "$_.bak") } mkfiles(1..5) }
+END { unlink_all map { ($_, "$_.bak") } @files }