in reply to Re^2: Getting next line after matched one
in thread Getting next line after matched one
loop is short forwhile (<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.while (defined($_ = <FOO>)){
|
|---|