my @a = qw(a b c d); # 0 1 2 3 print "@a\n"; # a b c d splice @a, 2, 0, qw(ba bb bc); print "@a\n"; # a b ba bb bc c d
See what perlfunc has to say about splice.
In reply to Re: insertion of array element
by wog
in thread insertion of array element
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |