Reasonably accurate SLOC counter.
Prints the number of line-blank lines in all matching files in the current directory. Modify as needed to work with other file types, it currently works with *.c and *.h files.
perl -n -e 'print unless /^\s*$/' *.[ch] | wc -l
Thanks, Perl and Lula mailing list.