my $element = splice(@$after, 0, 1); #remove element 0; splice(@$after, 4, 0, $element); #insert element at offset 4