Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I would like to add some arrays to an existing array so that I end up with an array of arrays. I have tried push, but this just adds the elements of the sub-array to the master array. I would like the value of the elements in the master array to be the sub-arrays themselves.
I have also tried:
$masterarray[0]=@subarray0; $masterarray[1]=@subarray1;
etc. , but this just assigns the first element of the subarray, instead of the whole subarray, to the element of the master array.
Help!
TIA,
C
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: creating arrays of arrays
by Zaxo (Archbishop) on May 06, 2004 at 16:26 UTC | |
|
Re: creating arrays of arrays
by davido (Cardinal) on May 06, 2004 at 16:29 UTC | |
|
Re: creating arrays of arrays
by Fletch (Bishop) on May 06, 2004 at 16:27 UTC | |
|
Re: creating arrays of arrays
by Art_XIV (Hermit) on May 06, 2004 at 20:22 UTC |