if ( ( $line[3] eq ":remove" ) && ( defined $line[4] ) ) { open my $handle1, '<', $srcpath or die "Cant open File: $!"; my @list; my $search = "$line[4]"; print Dumper($search); while ( my $x = <$handle1> ) { # VORSICHT HIER; PRUEFE mal den INHALT VON $x chomp $x; if ( $x ne $search ) { push @list, $x; # WO KOMMT DER UMBRUCH HER? print "$x"; } } print "AAAA @list"; close($handle1); open my $handle2, '>', $srcpath or die "Cant open File: $!"; foreach my $o (@list) { print $handle2 "$o\n"; } close($handle2); }