martymart has asked for the wisdom of the Perl Monks concerning the following question:
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";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: word boundary match problem
by Mr. Muskrat (Canon) on Jun 23, 2003 at 16:21 UTC | |
|
Re: word boundary match problem
by BrowserUk (Patriarch) on Jun 23, 2003 at 16:25 UTC | |
by gellyfish (Monsignor) on Jun 23, 2003 at 16:33 UTC | |
|
Re: word boundary match problem
by gellyfish (Monsignor) on Jun 23, 2003 at 16:25 UTC | |
|
Re: word boundary match problem
by Zaxo (Archbishop) on Jun 23, 2003 at 16:25 UTC | |
|
Re: word boundary match problem
by Tomte (Priest) on Jun 23, 2003 at 16:28 UTC |