You can use splice:
splice( @a, 5, 0, $newelement)This will replace the fragment of list at index 5, with a length of 0, with the rest of the arguments, here a single element. See perldoc -f splice for more info.
In reply to Re: adding to the middle of a array
by mirod
in thread adding to the middle of a array
by stu96art
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |