http://www.perlmonks.org?node_id=1011546

Mark_Galeck has asked for the wisdom of the Perl Monks concerning the following question:

Hello, Camel on page 779 in the seek man section says " (...) follow growing file like this (...)
while (<LOG>) { grok($_); } sleep 15; seek LOG, 0, 1;
This contradicts what I am seeing! If the file is growing and I do <LOG>, sometimes I will get a line that does not end in '\n', and then the next call will get the continuation of the line. Clearly the WRONG thing. I would think one needs to check for the end of the line, and if it is not '\n' then seek back to the beginning and then sleep, or something like that. Clearly Camel cannot be wrong. So I must be wrong. Where am I wrong?