in reply to Counting words
my $max_words = 8; open F, "< d:\\temp\\perl\\test.txt" or die "Unable to open file\n"; undef $/; $data = <F>; @words = split /\W+/, $data; print join ':', @words[0..$max_words - 1]; [download]