my $count = 0; 11 while (<$fh_r>) { 12 if (/START/ .. /END/) { 13 $count++ if /START/; 14 print if ($count == 2); 15 } 16 }