in reply to Re^2: Getting next line after matched one
in thread Getting next line after matched one

Basically, whenever you evaluate <FOO> in scalar context, it reads the next line from the file handle FOO and returns it, or returns undef if you're at the end of the file. A normal
while (<FOO>){
loop is short for
while (defined($_ = <FOO>)){
So all you have to do to read the next line is execute <FOO> again, either by doing so directly and using the result, or by waiting for the next iteration of the loop (which will read it for you) and then dealing with it then (the flag, then, lets you know that last time you saw what you needed). Which is preferable depends on what else you need to do with what lines in the file.