in reply to Reading only new lines from a file

Assuming each line has something unique in it, such as a timestamp, you should only need to read the file backwards from the end, and stop when you read a line you've read before. Each run records the last line it has read, rather than the tell position.

The hard part of this has already been done for you by modules such as File::ReadBackwards and File::Bidirectional.

A word spoken in Mind will reach its own level, in the objective world, by its own weight

Replies are listed 'Best First'.
Re^2: Reading only new lines from a file
by dsheroh (Monsignor) on Sep 01, 2007 at 01:12 UTC
    Based on another recent thread (Emulating command line pipe), it appears that File::ReadBackwards, at least, is rather slow and quick execution is a concern here. File::Bidirectional I don't know enough to comment on.