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:
Amiga
Atari
Commodore
DOS
FM Towns/JPY
Macintosh
Macintosh JP
Macintosh to JP
NeXTSTEP
RISC OS/Acorn
Shift JIS
UTF-8
Wrap
Text File
|
1990-12-18
|
278 b
|
8 lines
$tchars += $chars += length;
$twords += s/\S+/$words++/eg;
next unless eof;
printf "%8d %8d %8d %s\n", $., $words, $chars, ($ARGV eq '-'?'':$ARGV);
$tlines += $.; reset 'wc'; $. = 0;
next unless $files++ && eof();
printf "%8d %8d %8d %s\n", $tlines, $twords, $tchars, "total";