my $last_pos = 0; # start at the beginning # later.... seek(FILE, $last_pos); # go to where I was while () { # start reading line at a time if (/$userid/) { # sure about the /o, BTW? $last_pos = tell(FILE); # remember this spot .... # other stuff #### my %index; while () { $userid = split(...) # It's in there somewhere, right? $index{$userid} = tell(FILE}; } # later... seek(FILE, $index{$userid}); $_ = ; ($inv, $date, $amt) = split (...);