I have an if expression in which I am trying to match multiple strings using the || operator. I would like to reuse my IF statement to search for other sets of strings. What is the proper way to store these sets of strings? I have something like this:
if( /sdfsd/||/abc/||/def/||/hijk/ ) {.....}
I would like to turn it into something like this:
$a = /sdfsd/||/abc/||/def/||/hijk/; $b = /qqqq/||/ff/||/wqeoir/; if ($a) {...}
In reply to Storing pattern matches by joshywashy
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |