foreach (@Zeilen){ if (defined $dokuart && defined $zahl1){ print "test1"; if (/$dokuart\;$zahl1\;(\d+)/){ print "test2"; $zahl1 = $1;