Reputation: 1067
I want to print each element in an array separating with tab. Here is the code I wrote:
print FILEOUT $_,"\t" foreach @data;
I have problem while printing. Extra tab is printing from beginning of the second line.
Can some one help me in this?
Upvotes: 0
Views: 437
Reputation: 16
I think there is a "\n" at the end of each element of @array.
my @data = ("1\n", "2\n", "3\n");
print join "\t", map { chomp; $_; } @data;
print "\n";
Upvotes: 0