open (DATEI2, "> $upload_directory/$datei2") or die "Couldn't open: $!"; while ($i < length ($seq) ) { ... if ($ii == 50) { print DATEI2 "\n>$kopf\n$dna"; $dna = ""; $seq_dna = ""; $ii = 0; $iii++; } } close DATEI2;