#!/usr/bin/perl -n while (m/\w+/g) { $count++ } END { print "count: $count\n" }