if(index($text,"Bedingung 1")) { if(index($text,"Bedingung 2")) { print "gefunden\n"; } else { print "nicht gefunden\n" } } else {print "nicht gefunden\n"}