Is there any reason the following shouldn't work?
perl -pe 's/\n\n/foo/;'
...no I don't speak perl.
I'm doing this via, "filer thru command".
Yes,
When you use the -p switch, it takes the input (from the stdin pipe) and processes it, line by line. So, a line will have no more than one "\n" in it.
See the documentation for the "-p" switch here: http://perldoc.perl.org/perlrun.html
What you may want to do is this:
perl -pe 'BEGIN {$/=undef} s/\n\n/foo/'
$/ is the Perl special variable for the end-of-line delimiter. Changing it to undef causes it to read the input in all at once.
On May 21, 2006, at 3:40 PM, Oliver Taylor wrote:
Is there any reason the following shouldn't work?
perl -pe 's/\n\n/foo/;'
...no I don't speak perl.
I'm doing this via, "filer thru command".
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate