This is a sort of crude first crack at it to get you started. I haven't accounted for having an array that doesn't have some multiple of three elements.
use 5.010; foreach my $n ( 0 .. $#array/3 ) { my $i = $n * 3; say join q{,}, @array[ $i, $i+1, $i+2 ]; }
In reply to Re: Group array in threes
by kyle
in thread Group array in threes
by joec_
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |