in reply to Matching a long list of phrases
Using grep, you can store to a list with qw and match to it. This eliminates the need for the messy | and other such delimiters. If I find myself using delimiters, I like to use non-keyboard delimeters ( chr(1); #for example ). Have fun.my @phrases = qw{ one two three } ; my $in = 'three' ; if ( grep ( /$in/, @phrases ) ){ ... }
|
|---|