#!/bin/perl -w my $line = 0 while (<>) { $line += tr/ \t\r\n/c; } print $line, "\n";