I would probably just damage stuff if I attempted to use CVS... However,
here's my patch to perlfaq4 - if it's accepted I'll turn it into a diff
file:

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-
=head2 How do I insert items into the middle of an array?

Use L<perlfunc/"splice"> with a LENGTH value of 0. L<perlfunc/"splice">
accepts 4 arguments - the array to remove items from, the position to start
from in the array, the number of elements to remove (LENGTH), and a list of
elements to replace them with.

The following code inserts the value, "abcdef" into the array, to make it
element number 4.

C<splice(@array, 3, 0, "abcdef");>

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-

Comments welcomed.

+Pete

-------------------------------------------------------
($_='Yw_xUabcdtefgdijktljkotiersjkUzxT
yvlkbfdtcierstajogvPruntRshackRJelov')
=~y/RTUv;wxYz$/ ~'\/;$=();/;eval;print






Reply via email to