If you want to match only the exact words, not longer strings containing them use
$_ =~ /^$words$/
The ^ states that the word must be found at the very beginning of the line, $ means the very end.
Jenda
In reply to Re: regex question
by Jenda
in thread regex question
by gnu@perl
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |