in reply to remove single blank lines?

Here's my implementation -
$text =~ s/(?<=\b)\n(?=\n\b)//g;
Consider the string below -
This is line1\n \n line3\n \n \n
What the regex will do is to get rid of the '\n' at the end of line1, which is followed by another \n and a word boundary.

This solution is similar to qq's answer above, but with subtle differences. qq's solution will replace two consecutive \n's with a single \n, while my solution will get rid of the first \n.