ok( -f -s 'TEST' == 1 );
# now with an empty file
-open my $fh, ">", "foo";
+my $tempfile = tempfile();
+open my $fh, ">", $tempfile;
close $fh;
-ok( -f "foo" );
-is( -s "foo", 0 );
-is( -f -s "foo", 0 );
-is( -s -f "foo", 0 );
-unlink "foo";
+ok( -f $tempfile );
+is( -s $tempfile, 0 );
+is( -f -s $tempfile, 0 );
+is( -s -f $tempfile, 0 );
+unlink $tempfile;
# test that _ is a bareword after filetest operators
chdir('op') || chdir('t/op') || die "sysio.t: cannot look for myself: $!";
@INC = '../../lib';
+require '../test.pl';
open(I, 'sysio.t') || die "sysio.t: cannot find myself: $!";
print 'not ' unless ($a eq "#!.\0\0erl");
print "ok 10\n";
-$outfile = 'sysio.out';
+$outfile = tempfile();
open(O, ">$outfile") || die "sysio.t: cannot write $outfile: $!";
# How about command-line arguments? The problem is that we don't
# always get some, so we'll run another process with some.
SKIP: {
- my $arg = catfile(curdir(), tempfile());
+ my $arg = tempfile();
open PROG, "> $arg" or die "Can't create $arg: $!";
print PROG q{
eval { join('', @ARGV), kill 0 };