[perl #61224] .eof returns false if last read call read the last byte of the file, but not beyond

[email protected] (Jonathan Worthington)
Newsgroups perl.perl6.internals
Message-ID <[email protected]>
# New Ticket Created by  Jonathan Worthington 
# Please include the string:  [perl #61224]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=61224 >


Hi,

It seems that the .eof() method on file handles can sometimes return 
true even if there is nothing more to read. This occurs when you have 
read upto the last byte of a file (e.g. when a readline reads up to the 
end of a newline, and that newline is the last thing in the file), but 
not beyond (which seems to be what causes the EOF flag to be set). I'm 
thinking this is the wrong behaviour?

Thoughts and fixes welcome!

Jonathan
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.