in reply to inserting elements in an array
Look at perldoc -f splice
Here is an example
sub strict; my @a1 = qw|a b c d e f|; splice @a1, 3, 0, 'x', 'y', 'z'; print join(',', @a1); print "\n";
Returns:
a,b,c,x,y,z,d,e,f
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: inserting elements in an array
by Xenograg (Scribe) on Feb 02, 2005 at 23:51 UTC | |
by davido (Cardinal) on Feb 03, 2005 at 00:19 UTC |