perl -p reads a line at a time, so it never sees any more than one \n at once. Try this:
perl -pi -e 'BEGIN{undef $/} s/\n\n/\n/g;' foo.txt
In reply to Re: how to use matching operator on newlines
by kyle
in thread how to use matching operator on newlines
by redss
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |