in reply to perl
A one-liner that will do this:
perl -ne '$count++ unless /\S/; print "$count\n" if eof' <filename
In Section
Seekers of Perl Wisdom
in reply to perl
perl -ne '$count++ unless /\S/; print "$count\n" if eof' <filename