note moritz Here is a Perl 6 solution in a single statement. It's probably not the best solution, but it does work today in [http://rakudo.org/|rakudo]: <code> my @l = <a bb c d e f g h>; sub chunky(@l, \$len) { (0, \$len ...^ *>=@l).map({@l[\$_ .. (\$_ + \$len - 1 min @l.end)] ~ "\n" }).join } print chunky(@l, 3); </code> <p>The <c>0, \$len ...^ *>=@l</c> creates a list in steps of <c>\$len</c>, up to (but excluding) the number of elements in <c>@l</c>. <p>Inside the map there is an array slice. The <c>min @l.end</c> is only necessary because Rakudo doesn't clip array slices to the end of the list yet (which is a known and reported bug). <p>I'm still looking for a nicer solution, will update my post if I find one. <p><b>Update</b>: Nicer solution: <code> my @l = <a bb c d e f g h>; sub chunky(@l, \$len) { (@l Z (' ' xx \$len - 1, "\n") xx *).join.substr(0, -1) ~ "\n"; } print chunky(@l, 3); </code> <p>This creates an infinite list <c>(' ', ' ', "\n", ' ', ' ', "\n", ...)</c>, and then zips the input list with it. (zip = takes one item from each list in turn). Zips stops when the shortest list is exhausted, so we don't have to worry about it looping forever. <p>The result is then joined together, and the last separator is unconditionally substituted for a newline. <div class="pmsig"><div class="pmsig-616540"> [http://perl6.org/|Perl 6] - links to (nearly) everything that is Perl 6. </div></div> 861938 861938