#!/usr/local/bin/perl $wordcount = 0; $line = ; while ($line ne "") { chop ($line); @words = split(/[\t ]+/, $line); $wordcount += @words; $line = ; } print ("Total number of words: $wordcount\n");