sub qrany { $_ =~ $_[0] && return 1 for @_[1 .. $#_]; return } sub cany { index($_[0],$_) != -1 && return 1 for @_[1 .. $#_]; return } sub eqany { $_ eq $_[0] && return 1 for @_[1 .. $#_]; return } # Contains tests if (cany( $string, qw[this or_this or_that]) {.... or # Equality tests if (eqany( $string, qw[this or_this or_that]) {.... or # Regex tests if (qrany( $string, qr/one regex/, qr/another regex/, qr/yet another regex/ )) { ....