Skip Menu |

This queue is for tickets about the File-Slurper CPAN distribution.

Report information
The Basics
Id: 125268
Status: new
Priority: 0/
Queue: File-Slurper

People
Owner: LEONT [...] cpan.org
Requestors: bitcard [...] harkless.org
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in:
  • 0.010
  • 0.011
  • 0.012
Fixed in: (no value)



Subject: 20-no-side-effects.t has side-effect of leaving mysterious snowman in tmp
I was doing some cleanup in my system /tmp directory and found a weird file called FKq72ErmSX with the content: Snowman! ☃ I was slightly concerned this might be the calling card of some malicious software, but Googling didn't turn up anything. I then did a systemwide grep for 'Snowman!' (left out the emoji in case it was encoded in the source, as indeed it turned out to be), and found it in .cpan/build/File-Slurper-0.010-0/t/20-no-side-effects.t. Kind of ironic that a file with that name has a side effect like that. I see you're calling tempfile() as: my ( $outfh, $outputfile ) = tempfile(); and not doing anything to explicitly delete the file at the end of the test. Please either manually delete it, or call tempfile() in such a way that it's auto-deleted. From the File::Temp docs: ($fh, $filename) = tempfile($template, UNLINK => 1); Return the filename and filehandle as before except that the file is automatically removed when the program exits (dependent on $KEEP_ALL). Default is for the file to be removed if a file handle is requested and to be kept if the filename is requested. In a scalar context (where no filename is returned) the file is always deleted either (depending on the operating system) on exit or when it is closed (unless $KEEP_ALL is true when the temp file is created). Use the object-oriented interface if fine-grained control of when a file is removed is required. I haven't tried building File-Slurper-0.012, but I confirmed that 20-no-side-effects.t is unchanged in it. Thanks much, [Odd to manually sign a bug report, but having acct. Dan Harkless migration problems I'm about to report to admin.]