perl bug

Greg Lee lee at uhccux.UUCP
Fri Feb 5 12:23:17 AEST 1988


Perl, patchlevel 11 on Ultrix 1.2, fails tests 3 and 12 of
t/io.tell.  It seems that when you are at the end of a file
and access the file descriptor, something funny happens.  The next
test for end of file works, but subsequent ones do not work correctly.
  I attached below a script that exhibits the difficulty perhaps
more plainly.  Not saying its really a bug -- I may well have made
a mistake of some sort.
	Greg, lee at uhccux.uhcc.hawaii.edu
		-------------------

#!./perl
# perl fails io.tell tests 3 and 12.  Furthermore, this
# script gives funny results ...

open(tst, '../Makefile') || (die "Can't open ../Makefile");

if (seek(tst,0,2)) { print "ok 11\n"; } else { print "not ok 11\n"; }
# if next line present, 2nd eof test below fails
if (<tst>) { print "<tst> true\n"; } else { print "<tst> false\n"; }
if (eof(tst)) { print "STILL EOF\n"; } else { print "LOST EOF\n"; }
# if next line present as well as preceding, dumps core
#if (<tst>) { print "<tst> true\n"; } else { print "<tst> false\n"; }
if (eof(tst)) { print "STILL EOF\n"; } else { print "LOST EOF\n"; }

# Output of this script is:
#   ok 11
#   <tst> false
#   STILL EOF
#   LOST EOF



More information about the Comp.sources.bugs mailing list