ONCE: my $regex = join "", "^(?s)", map "(?=.*?\Q$_\E)", @words; $regex = qr/$regex/; ... AS_NEEDED: $found_all = $target =~ $regex;