in reply to Re: multiple "newline" delimiters
in thread multiple "newline" delimiters

I would most often use this approach myself. It, at least, will handle any situation thrown at it.

Unfortunately you also have to execute my_process_line($line) after the while loop to deal with the very last line/block.

Also, you'd need to consider the impact if there were multiple matches within the buffered line.

Finally if there were multiple matches on the buffered line you'd want to discard the processed data but retain that portion of the buffer at the end that didn't match so it could be appended to the next buffer read.