in reply to Re^2: How to optimize a regex on a large file read line by line ?
in thread How to optimize a regex on a large file read line by line ?

The match is only in one line, that's the purpose of the line

$_ .= <$fh> // '';

It completes a partial line.

Replies are listed 'Best First'.
Re^4: How to optimize a regex on a large file read line by line ?
by LanX (Saint) on Apr 18, 2016 at 09:21 UTC
    Ahh! You are combining read with readline ...

     $_ .= <$fh> // ''; # finish partial line

    That's a good trick!

    (As long as a line doesn't become bigger than memory, but that's hardly the case here.)

    Cheers Rolf
    (addicted to the Perl Programming Language and ☆☆☆☆ :)
    Je suis Charlie!