in reply to Re: while behaviour on binary files
in thread while behaviour on binary files

Thank you very much for your suggestions ikegami. The first one (!eof(DATFILE) solved my problem. I'll read up on while to understand why !eof changes the behaviour of while. After all I came here to seek wisdom and the journey to the solution often teaches you more than the solution itself. Thanks for pointing the direction I in which I have to travel. I'll also look into your other solutions and use that to make my code better. Sincerely, Hans

Replies are listed 'Best First'.
Re^3: while behaviour on binary files
by Anonymous Monk on Nov 14, 2013 at 19:21 UTC
    Your misunderstanding is that <DATFILE> actually _reads_ from the file until the next end-of-line character. (You then throw away the data.) It's not the test for end-of-file. eof() is.