in reply to Word Evaluation
Let me see if I understand your problem: you have a list of strings, such as "bar", "bartender", and "foobar". You want to get rid of any duplicates, but you have to make sure that "bar" won't match against "bartender" or "foobar".
First solution that comes to mind is to ignore the regex and simply use string eq:
next if($word eq $w);If you really need a regex for some reason, use \s to match whitespace around the word:
next if($word =~ /\s$w\s/);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Word Evaluation
by Gilimanjaro (Hermit) on Jan 29, 2003 at 17:21 UTC | |
by integral (Hermit) on Jan 29, 2003 at 19:57 UTC |