push(@insert_historyeinstellkosten,"$row_csv[8];$row_csv[1]\n"); ... open(INPUT,'>'.$newdata); foreach(@insert_historyeinstellkosten) { print INPUT $_; } close INPUT;