"be consistent" | |
PerlMonks |
Re: one line to check for common list valuesby Anonymous Monk |
on Feb 25, 2017 at 18:12 UTC ( [id://1182830]=note: print w/replies, xml ) | Need Help?? |
There's a trick for jamming an expression into a string or regex: my @result = "@input" =~ /@{[join "|", map "\\b$_\\b", @valuesToMatch]}/g;But you're probably better off using a hash for this. It'll be much faster if the arrays are large.
In Section
Seekers of Perl Wisdom
|
|