>> Is there any reason the following shouldn't work? >> >> perl -pe 's/\n\n/foo/;' > What you may want to do is this: > > perl -pe 'BEGIN {$/=undef} s/\n\n/foo/' I tried that, but this does not allow me to use "^" to denote the beginning of a line, which is critical to some of the search/replace things I'm doing. Any other thoughts?