Tuppence has asked for the wisdom of the Perl Monks concerning the following question:
Hello monks,
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.
I'm trying to run a multi-line search replace against a file from the command line.
Simplified, I want
perl -pi -e 's/(.*)/{\1}/gs' filename.txtto put a { } wrapper around the entire file. Instead, it puts a { } wrapper around each line. (and some weird extra ones, but eh whatever)
I thought this could be solved with something like -l0666, but I can't find why I think that and it already toasted my code tree once...
Tuppence
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: multi-line in-place edits
by cog (Parson) on Feb 15, 2005 at 19:05 UTC | |
Re: multi-line in-place edits
by bmann (Priest) on Feb 15, 2005 at 19:33 UTC | |
Re: multi-line in-place edits
by Roy Johnson (Monsignor) on Feb 15, 2005 at 19:38 UTC | |
Re: multi-line in-place edits
by holli (Abbot) on Feb 15, 2005 at 19:36 UTC | |
by jsprat (Curate) on Feb 16, 2005 at 01:18 UTC | |
Re: multi-line in-place edits
by sh1tn (Priest) on Feb 15, 2005 at 19:00 UTC | |
by Tuppence (Pilgrim) on Feb 15, 2005 at 19:02 UTC | |
| |
Re: multi-line in-place edits
by halley (Prior) on Feb 15, 2005 at 19:23 UTC | |
by Tuppence (Pilgrim) on Feb 15, 2005 at 20:08 UTC | |
Re: multi-line in-place edits
by sh1tn (Priest) on Feb 15, 2005 at 20:43 UTC |
Back to
Seekers of Perl Wisdom