sub is_match { grep { $string =~ /$_/ and return 1 } @regex; } if ( is_match() ) { print qq($string matched some regex); }