in reply to Print AOA into tab sep values

One way:
for $row ( @out ) { print join( "\t", @$row), "\n"; }

Another way:

$, = "\t"; # Output field separator for $row ( @out ) { print @$row, "\n"; }

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

Replies are listed 'Best First'.
Re^2: Print AOA into tab sep values
by ikegami (Patriarch) on Apr 14, 2008 at 11:29 UTC

    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.

      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.