In the join, you might want to map quotemeta over @list so that any meta-chars (particulary |) get escaped.
Also you have to be careful that none of the strings are prefixes of another string, otherwise you'll find that ordering is significant in an alternation.
--
integral, resident of freenode's #perl
In reply to Re^2: creating a regular expression's alternation dynamically?
by integral
in thread creating a regular expression's alternation dynamically?
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |