Try this:
if ($string =~ m/^(this|or_this|or_that)$/i) { ... }
update: Since I'm being downvoted, maybe I wasn't clear enough. I replaced eq with =~ and inserted the ^ (beginning of line) and the $ (end of line) matching operators. This to ensure that you receive an exact match for "this" or "or_this" or "or_that" (otherwise "foothisbar" would have matched).
--
dempa
In reply to Re: matching strings...
by dempa
in thread matching strings...
by powerhouse
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |