in reply to Reading in N lines at a time

This will read 6 lines, then let you do something else then return to reading another 6 lines until the end of the file. (start up code and Template code omited as the former is not changed and I don't know any thing about the latter =)
... until (eof(FH)) { for my $i (1..6) { my $line = <FH>; last unless defined $line; chomp $line; redo if ($line =~ /^\s*(?:#|$)/); if ($line=~m#(map|reverse_map)\s+(\w+)://(\S*?)\s+(\2)://(\S*? +)$#) { $vars{'d'} = $.; $vars{'map'} = $1; $vars{'proto'} = $2; $vars{'uri1'} = $3; $vars{'uri2'} = $4; } } #do some thing with $vars before here. #6 lines (or as many as remained in the file) will have been read +at this point }