in reply to Out of memory
my @words; my $len; while (<TEXT>) { $len += @words = split /\s+|[,:]/; } print "LEN = $len\n"; [download]
The regex here is a guess at what you might need.
-- John.