#!/usr/bin/perl -- use strict; use warnings; use Data::Dump; use List::AllUtils qw' natatime '; my @x = ('a' .. 'z'); my $it = natatime 5, @x; my @yo; while (my @vals = $it->()) { push @yo, "@vals,\n"; } chomp $yo[-1]; chop $yo[-1]; dd \@yo; __END__ [ "a b c d e,\n", "f g h i j,\n", "k l m n o,\n", "p q r s t,\n", "u v w x y,\n", "z", ]