in reply to matching strings...
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: matching strings...
by powerhouse (Friar) on Jan 27, 2003 at 07:52 UTC |