http://www.perlmonks.org?node_id=193467


in reply to Number of lines and characters

If you only have to do this with one file the counter in word is pretty good. tools->word count. Otherwise, assuming you have already opened the word document so that perl can read it (using one of the windows modules) you could do something like.
while (<FILE>) { if(/\w/) { count ++; } }