my $state = "ok"; my $pos = 0; my $record; while ( ($pos+12) < length($f_content)) { $record = substr($f_content,$pos+3,4); if ($record == "2500" || $record == "2800") { substr($f_content,$pos,128, ""); } # löschen funktioniert