http://www.perlmonks.org?node_id=591359


in reply to Syntactically cool list of lists

$ perl -MData::Dumper -wle ' $s = 5; @a = (1,5,7,9,32,197,8,4,5); $e=int $#a/$s; @b = map {$_*=$s; [@a[$_..($_+$s>$#a?$#a:$_+$s-1)]]} 0..$e; print Dumper \@b '
$VAR1 = [ [ 1, 5, 7, 9, 32 ], [ 197, 8, 4, 5 ] ];

-- 
Ruud