in reply to Out of memory


It is inefficient to read a file this large into memory. Instead you should process the file line-by-line:
my @words; my $len; while (<TEXT>) { $len += @words = split /\s+|[,:]/; } print "LEN = $len\n";

The regex here is a guess at what you might need.

--
John.