I know how to use wc in unix to figure out words, characters, lines
but how about Perl, what approach should I take?
Lots of different approaches. I'll try some that won't win any obfuscation contests:
Lines:
Words: (loosely defined as whitespace-delimited tokens)
Words: (defined as whitespace-delimited tokens containing a letter)
Characters: (not including line-feeds, but including all others, ie, whitespace)
Characters: (not including whitespace)