Unicode-Tussle
view release on metacpan or search on metacpan
script/uniwc view on Meta::CPAN
@paras, @lines, @words,
$paracount, $linecount, $wordcount,
$grafcount, $charcount, $bytecount,
);
if ($charcount = length($_)) {
#$wordcount = 0;
$wordcount++ while /\P{Space}+/g;
#$wordcount = eval { @words = split m{ \p{Space}+ }x };
#yuck "error splitting words: $@" if $@;
#$linecount = 0;
$linecount++ while /\R/g;
#$linecount = eval { @lines = split m{ \R }x };
#yuck "error splitting lines: $@" if $@;
#$grafcount = 0;
$grafcount++ while /\X/g;
#$grafcount = eval { @lines = split m{ \R }x };
#yuck "error splitting lines: $@" if $@;
$paracount = 0;
$paracount++ while /\R{2,}/g;
yuck "error splitting paras: $@" if $@;
if ($linecount && !/\R\z/) {
yuck("missing linebreak at end of corrupted textfile $file");
$linecount .= "*";
( run in 0.890 second using v1.01-cache-2.11-cpan-71847e10f99 )