my $string = 'test'; my $var = 'da'; for($string,$var){ print "d kommt nicht in $_ vor\n" if($_ !~ /d/); # wichitg: !~ }