in reply to Write array contents to csv file

If you give working code and useable data, you'll probably get advice on a working solution much faster.

Why don't you just add $empid to your array, and then join them in a separate statement, like;

push(@array, $empid); $string = join("\t", @array); print STDOUT "$string\n";

Michael