in reply to Re^2: splitting files by number of words
in thread splitting files by number of words

or you could just use
$total_words += split while(<DATA>);
cheers, si_lence