my @strings = qw ( abc def der ); my $string = join ("|", @strings); my $test = "defined"; if ($test =~ m/$string/i){ print "GEFUNDEN! ($&)\a\a\a\a"; } <>;