From: Nicholas Clark Date: Wed, 29 Oct 2008 19:34:05 +0000 (+0000) Subject: Avoid leaving a VAR.txt after testing terminates on any platform where X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=cb1ea1622d4ada2138a66363f92a63d6d66fab96;p=p5sagit%2Fp5-mst-13.2.git Avoid leaving a VAR.txt after testing terminates on any platform where you can't unlink an open file by instead opening $^X for read to get a file handle for test purposes. p4raw-id: //depot/perl@34639 --- diff --git a/ext/XS/APItest/t/svpeek.t b/ext/XS/APItest/t/svpeek.t index 3afb039..69d80d7 100644 --- a/ext/XS/APItest/t/svpeek.t +++ b/ext/XS/APItest/t/svpeek.t @@ -58,11 +58,10 @@ like (DPeek ($1), qr'^PVMG\("', ' $1'); is (DPeek (sub {}), '\CV(__ANON__)', 'sub {}'); { our ($VAR, @VAR, %VAR); - open VAR, ">VAR.txt"; + open VAR, "<", $^X or die "Can't open $^X: $!"; sub VAR {} format VAR = . - END { unlink "VAR.txt" }; is (DPeek ( $VAR), 'UNDEF', ' $VAR undef'); is (DPeek (\$VAR), '\UNDEF', '\$VAR undef');