http://www.perlmonks.org?node_id=559615


in reply to Re^2: Matching in huge files
in thread Matching in huge files

Yep, it is very fast, but why is that better than this:
open(F, "<", $file) or die "$file: $!"; binmode(F); undef $/; # switch off end-of-line separating # read file in large chunks while (<F>) { while ( m/$re/oigsm ) { print "$1\n"; } } $/ = '\n'; # switch back to line mode close(F);

?

Thanks,
Tamas