sub split_into { my $howmany = shift; my @from = reverse @_; reverse map { [ reverse splice(@from, 0, @from / $_) ] } reverse 1 .. $howmany; }