open FH, "file"; while () { last if /regexp/; } while () { do something; }