Just another Perl shrine | |
PerlMonks |
Re^2: File handles in regular expressionsby Lotus1 (Vicar) |
on Oct 18, 2012 at 19:19 UTC ( [id://999799]=note: print w/replies, xml ) | Need Help?? |
Hi. Did you choose to use Tie::File instead of just reading file1.txt into an array so that very large files could be handled? If so there is a problem with concatenating all the output into a scalar. $matched_lines could end up holding the whole huge file. One possible solution is to replace $matched_lines .= $match.$/; with print $fh $match.$/; Just print incrementally.
In Section
Seekers of Perl Wisdom
|
|