stu96art has asked for the wisdom of the Perl Monks concerning the following question:
So I want to add the element and expand the array by one. Is this close?$newelement = 54; for $i (5..($last + 1)) { $temp = $a[$i]; $a[$i] = $newelement; $newelement = $a[($i+1)]; }
update (broquaint): title change (was adding to the middle of a array)
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: adding to the middle of a array
by mirod (Canon) on Feb 13, 2003 at 09:52 UTC | |
Re: adding to the middle of a array
by TheHobbit (Pilgrim) on Feb 13, 2003 at 09:56 UTC | |
by htoug (Deacon) on Feb 13, 2003 at 11:33 UTC | |
by TheHobbit (Pilgrim) on Feb 13, 2003 at 11:40 UTC | |
by Anonymous Monk on Feb 14, 2003 at 17:56 UTC |