#!/usr/bin/perl -n # counts words and lines in a file @words = split /\W+/; $words = @words; END { print "lines -> $.\nwords -> $words\n"; }