in reply to Need to skip two lines

drodinthe559 you seem to think that next will not alter the control flow of your program , which in this case it does alter. In other words , you cannot write two consecutive next statements and hope that you will skip 2 iterations of the while loop. However , you can skip 2 iterations like this
while(<SOURCE>) { my $source = $_; if($source =~ m/^(\s)*$/) { $source = <SOURCE> for 1..2; } #Go through each line until you hit page 1 of sorter 2 if (substr($source,145,16) =~ <b>/Page:\s*1/)</b> { $source = <SOURCE> for 1..2; if (substr($source,72,9) =~ /Sorter: 2/) { ++$dcount; printf LOGFILE $source; } } }