my $req_regx = join( '|', @required );
This is ok for the "pure" words given in the example, but there may be trouble if naughty regex metacharacters like * + ? ( ) [ ] etc. infiltrate the word list. See haukex's article Building Regex Alternations Dynamically for a thorough discussion of this technique.
Give a man a fish: <%-{-{-{-<
In reply to Re^2: Matching words
by AnomalousMonk
in thread Matching words
by PerlMonger79
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |