#!/usr/bin/perluse warnings;use strict;my @words = split ('\s+', <>); #read some text and split on whitespacemy $words = scalar (@words);print "There ", ($words == 1)?"is":"are"," $words word", ($words == 1)?"":"s"," in the text \n";