in reply to
Group array in threes
Read up on the
natatime
function in the
List::MoreUtils
CPAN module. It does exactly what you want to do and has example code you can copy'n'paste. You'll have to adapt it to
print
out commas instead of whitespace between elements.
Comment on
Re: Group array in threes
Download
Code
In Section
Seekers of Perl Wisdom