Thanks for your help,#!/usr/bin/perl use strict; open (SOURCE, "test.txt")||die "Can't open test.txt: $!"; my @source=<SOURCE>; close (SOURCE); my $size=0; while(<@source>){ $size++ while m{\b\w+\b}g; } print "wordcount: $size words\n";
In reply to word boundary match problem by martymart
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |