Convert all unimaginative (ie race condition) temporary file names to
[p5sagit/p5-mst-13.2.git] / t / io / read.t
index 6d590ff..57e671d 100755 (executable)
@@ -1,7 +1,5 @@
 #!./perl
 
-# $RCSfile$
-
 BEGIN {
     chdir 't' if -d 't';
     @INC = '../lib';
@@ -14,7 +12,9 @@ die $@ if $@ and !$ENV{PERL_CORE_MINITEST};
 
 plan tests => 2;
 
-open(A,"+>a");
+my $tmpfile = tempfile();
+
+open(A,"+>$tmpfile");
 print A "_";
 seek(A,0,0);
 
@@ -25,12 +25,8 @@ read(A,$b,1,4);
 
 close(A);
 
-unlink("a");
-
 is($b,"\000\000\000\000_"); # otherwise probably "\000bcd_"
 
-unlink 'a';
-
 SKIP: {
     skip "no EBADF", 1 if (!exists &Errno::EBADF);