home *** CD-ROM | disk | FTP | other *** search
/ InfoMagic Source Code 1993 July / THE_SOURCE_CODE_CD_ROM.iso / languages / perl / scripts-convex / clones / wc2.pl < prev    next >
Encoding:
Text File  |  1990-12-18  |  278 b   |  8 lines

  1. $tchars += $chars += length; 
  2. $twords += s/\S+/$words++/eg;
  3. next unless eof;
  4. printf "%8d %8d %8d %s\n", $., $words, $chars, ($ARGV eq '-'?'':$ARGV);
  5. $tlines += $.; reset 'wc'; $. = 0;
  6. next unless $files++ && eof();
  7. printf "%8d %8d %8d %s\n", $tlines, $twords, $tchars, "total";
  8.