in reply to arrange output in columns

This is literally a two-dimensional array ... then iterating through the first dimension of the array and using Text::CSV on each arrayref thus found.