Probably not what you're looking for, but I'd be tempted, without more context of where you're using this, to try:
But that probably doesn't quite fill your requirement, I'm betting.use List::Util qw(first); my $matched = first { $var =~ $_ } @pats;
In reply to Re: Programmatic regex disjunction
by Tanktalus
in thread Programmatic regex disjunction
by gaal
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |