open MYFILE, '>', '/tmp/pkgtest' or die "Can't open pkgtest: $!"; for (@array){ print MYFILE, $_, "\n"; } close MYFILE;