while (FH) { ++$counter; if (/1234556$) { ++$counter2; last; } }