To
insert elements, use a length of 0 for the slice (or use a length less than the number of new
elements).
@lucky = (1,2,3,4,5,6,7,8);
splice(@lucky, 2, 0, (9, 16, 25));
print "Lucky numbers are
@lucky.\n";
Lucky numbers are 1 2 9 16
25 3 4 5 6 7 8.