in reply to Reading from where I left off

I've not tried anything like this, but you could try using the Storable module. What I would do (you can probably come up with a better scheme) is something like this:

#!perl use strict; use warnings; use Storable qw(store retrieve freeze thaw dclone); $file = shift(@ARGV); open(FH,$file) or die "could not open $file because $!\n"; if($file_pointers = retrieve('fileposition')) { if(exists($file_pointers -> {$file}) { seek(FH, $file_pointers -> {$file},0) or die "could not seek to + '. $file_pointers -> {$file} . ' because $!\n"; } } while(my $keepreading) { if(defined($line = <FH>) { process($line); $keepreading = continue_question(); $file_pointers -> {$file} = tell(FH); } else { delete $file_pointers -> {$file}; } close(FH); store $file_pointers, 'fileposition');

Note that this code is NOT tested nor even compiled.

emc

" When in doubt, use brute force." — Ken Thompson