in reply to Opening a file at a designated offset based on closing of the file

You can use the tell() function to get the current file offset, and seek() function to get back to that offset, once you've reopened 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