$teststring = "1\n12\n123\n1234\n1234\n12345\n\n123456\n1234567\n";
# Create our test datafile
+1 while unlink 'foo'; # in case junk left around
+rmdir 'foo';
open TESTFILE, ">./foo" or die "error $! $^E opening";
binmode TESTFILE;
print TESTFILE $teststring;
if ($bar eq "12\n") {print "ok 2\n";} else {print "not ok 2\n";}
# Try a non line terminator
-$/ = "3";
+$/ = 3;
$bar = <TESTFILE>;
if ($bar eq "123") {print "ok 3\n";} else {print "not ok 3\n";}
if ($bar eq "78") {print "ok 10\n";} else {print "not ok 10\n";}
# Get rid of the temp file
+close TESTFILE;
unlink "./foo";
# Now for the tricky bit--full record reading
$bar = <TESTFILE>;
if ($bar eq "z\n") {print "ok 14\n";} else {print "not ok 14\n";}
- unlink "./foo.bar";
- unlink "./foo.com";
+ close TESTFILE;
+ 1 while unlink qw(foo.bar foo.com foo.fdl);
} else {
# Nobody else does this at the moment (well, maybe OS/390, but they can
# put their own tests in) so we just punt