in reply to Opening a file at a designated offset based on closing of the file
use strict; ## obtain $LastPosition open(LOG, '/var/log/messages'); seek(LOG, $LastPosition, 0); while (my $line = <LOG>) { chomp $line; ## Process $line; } $LastPosition = tell(LOG); close(LOG); ## store $LastPosition
|
|---|