http://qs321.pair.com?node_id=40814


in reply to perl

A one-liner that will do this:
perl -ne '$count++ unless /\S/; print "$count\n" if eof' <filename