EX: ... open(LIBIN, "gunzip -c $read_file |") or die "\nERROR: ..."; ... while($line = ) { $self->{LINENUMBER}++; $file_line_location{$self->{LINENUMBER}} = tell LIBIN; ..... # Return to the start of a section after pre-parsing seek LIBIN , $file_line_location{$section_reentry_line}, 0; .... }