perladdict has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
I am tring to find the duplicates words in a paragraph.
#!/usr/bin/perl -w $/=" "; while(<>) { while($_=~m/\b(\w+\b)(\s+\1)\b/xig) { print "dup words '$1' occurs at paragraph $.\n"; } }
After running this stuff,i unable to get the expected result.so,pls suggest me to get the correct result.
Code tags added by GrandFather
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Finding duplicate words in a paragraph
by Zaxo (Archbishop) on Jun 05, 2006 at 11:58 UTC | |
|
Re: Finding duplicate words in a paragraph
by liverpole (Monsignor) on Jun 05, 2006 at 11:37 UTC | |
|
Re: Finding duplicate words in a paragraph
by msk_0984 (Friar) on Jun 05, 2006 at 11:36 UTC | |
|
Re: Finding duplicate words in a paragraph
by ciderpunx (Vicar) on Jun 05, 2006 at 12:36 UTC | |
|
Re: Finding duplicate words in a paragraph
by japhy (Canon) on Jun 05, 2006 at 13:43 UTC |