in reply to Re: Print AOA into tab sep values
in thread Print AOA into tab sep values

moritz is right, $" is better than $, ($, leaves a TAB bebore NEWLINE)

Not at all. Just use $, in conjunction with $\.

{ local $, = "\t"; local $\ = "\n"; for my $row ( @out ) { print @$row; } }

Of course, the join method much clearer.

Replies are listed 'Best First'.
Re^3: Print AOA into tab sep values
by dvryaboy (Sexton) on Apr 15, 2008 at 13:10 UTC
    Joins are a little more expensive; If the number of elements in @out (num lines * num items per line) is in the millions, using $" is noticeably faster. If the expected size of the output will not be this huge, however, using join is much cleaner, as you pointed out.