note
hardburn
<p>That's a one-liner, provided your pattern is reasonably small. You don't need to open filehandles if you use perl's command line options and the shell to your advantage:</p>
<code>
perl -lne 'print if /pattern here/' old_file.txt > new_file.txt
</code>
<div class="pmsig">
<div class="pmsig-195718">
<p>----<br>
<code>: () { :|:& };:</code></p>
<p><b>Note</b>: All code is untested, unless otherwise stated</p>
</div></div>
345018
345018