in reply to Counting lines of C code

Yes, it's standard *nix/Cygwin utility called wc.

If you want a perl script, you should try and write one yourself (you should be able to do this even as a novice in just a couple of lines). Then if you run into a problem you can post your code and ask your question here.

grep
Just me, the boy and these two monks, no questions asked.