if new file { # read all lines and insert into db. # Save current position for next time... $current_line = tell(FH); } else if not new file { # Go to current line seek(FH,0,$current_line); # read all new lines and insert into db # Save position for next iteration... $current_line = tell(FH); }