my @var = 1 .. 38; while ( @var ) { my @splice = splice @var, 0, 10; print "@splice\n"; }