#!/usr/bin/perl -w

# Exemplo de filtro analogo ao "wc.c" da Aula 12 de MAC211
# M.S.Reis, 17.6.2010
#

use strict;
use warnings;

my ($nc, $nl, $nw);

while(<STDIN>){
    $nc += length $_;
    $nl++;
    my @palavras = split /\s+/, $_;
    $nw += @palavras;
}

print "$nl, $nw, $nc\n";
