in reply to Programmatic regex disjunction

Probably not what you're looking for, but I'd be tempted, without more context of where you're using this, to try:

use List::Util qw(first); my $matched = first { $var =~ $_ } @pats;
But that probably doesn't quite fill your requirement, I'm betting.

Replies are listed 'Best First'.
Re^2: Programmatic regex disjunction
by gaal (Parson) on Nov 21, 2005 at 17:12 UTC
    That is in fact exactly what I'm doing now. :-)

    ++