Did you consider reading the file all at once in a plain scalar?
If you really want to process the file/array line by line then you can add a while loop in your if-statement that does something (or maybe nothing if you don't need the lines) with the data of those line.
In reply to Re^3: Regex to select multiple lines
by Animator
in thread Regex to select multiple lines
by beeny
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |