# delete nothing but add to end or beginning of array: push @a,$x,$y splice(@a,@a,0,$x,$y) unshift @a,$x,$y splice(@a,0,0,$x,$y) # Remove first or last item from array: $t=pop @a $t=splice(@a,-1) $t=shift @a $t=splice(@a,0,1) # Replace item in middle of array $a[$i]=$y splice(@a,$i,1,$y)