perl -ne '0+$c|($c=/\S/)&&print'
Now, this depends on order of evaluation, and precedence, and other
stuff. Elegance was not a requirement.
Anyway, the question is this: Why is the 0+ necessary? The best I
can guess is that it provides a scalar context, but shouldn't the | do
that? I could see things getting confused if perl was using | for bit
vector manipulation, but since I'm not using vec, I don't think that's
happening, either. So, what's going on?
(As an aside, there's a shorter answer:
perl -00ne '/\S/&&print'
This has the interesting property that it sort of "fuzzy": it reduces
multiple blank lines to either one or two blank lines. But it's
really short :-)
Marc