my $file = "$log/test2.csv"; open( my $CSV, ">>", $file ) or die "Error: couln't append to file '$file': $!\n"; print $CSV "@erste_Zeile\n"; close($CSV) or die "Error: couldn't close file '$file': $!\n";