in reply to Re: Re: Re: Re: Two lines Regular Expression
in thread Two lines Regular Expression

It works by concatenating (with ".") the contents of $_ (your current line in this case) with the last line(s) read in. It is equivalent to: $_ = $_ . <YOURFILE>. You can have a look at perldoc perlop under "Assignment Operators" for a more detailed explanation.

If you have:

line one line two line three

the first time around, $_ is "line one\n", the second time around, $_ becomes "line one\nline two\n", and the third time around, $_ becomes "line one\nline two\nline three\n", which allows you to use your regex across more than one line in the file.

--
Allolex