my @new; while (@old) { push @new, [splice @old, 0, 3]; }