my $csvfile; push (@report,(join "\t", $empid, @array),"\n") foreach (@report) { print $_; print $csvfile $_; }