<?xml version="1.0" encoding="windows-1252"?>
<node id="431292" title="multi-line in-place edits" created="2005-02-15 13:54:48" updated="2005-08-01 08:27:42">
<type id="115">
perlquestion</type>
<author id="315160">
Tuppence</author>
<data>
<field name="doctext">
Hello monks,

&lt;p&gt;Having already replaced every \n in my source tree with \266 due to a bad command line, I need help with what I expected to be very simple.&lt;/p&gt;

&lt;p&gt;I'm trying to run a multi-line search replace against a file from the command line.&lt;/p&gt;

&lt;p&gt;Simplified, I want&lt;/p&gt;

&lt;code&gt;perl -pi -e 's/(.*)/{\1}/gs' filename.txt&lt;/code&gt;

&lt;p&gt;to put a { } wrapper around the entire file.  Instead, it puts a { } wrapper around each line. (and some weird extra ones, but eh whatever)&lt;/p&gt;

&lt;p&gt;I thought this could be solved with something like &lt;code&gt;-l0666&lt;/code&gt;, but I can't find why I think that and it already toasted my code tree once...&lt;/p&gt;

&lt;p&gt;Tuppence&lt;/p&gt;</field>
</data>
</node>
