print @array; open(IN, ">data.txt") or die $!; print IN @array; close IN;