Array Splices
Splicing an array involves changing, inserting, or deleting elements of the array.
@lucky = (1,2,3,4,5,6,7,8);
$offset = 2;
$length = 3;
splice(@lucky, $offset, $length, (9,16,25));
print "Lucky numbers are @lucky.\n";
Lucky numbers are 1 2 9 16 25 6 7 8.
Previous slide
Next slide
Back to first slide
View graphic version