baski has asked for the wisdom of the Perl Monks concerning the following question:
@msgs=(@msgs[0],@msgs1,@msgs2) where @msgs[0],@msgs1,@msgs2 are arrays of type $msglines.
How do I push $msglines to @msgs[0]?
My understanding was that array of arrays stores references to subarrays. So its illegal to sayNeedless to say above code doesnot work :(. How else to append to arrays inside arrays?@msgs=(); push(@msgs[0],$msglines); print "Size of first array ".($#(@($msgs[0]))+1)."\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Push into an array inside a array
by dasgar (Priest) on Sep 11, 2010 at 23:49 UTC | |
|
Re: Push into an array inside a array
by eyepopslikeamosquito (Archbishop) on Sep 12, 2010 at 00:26 UTC | |
|
Re: Push into an array inside a array
by toolic (Bishop) on Sep 11, 2010 at 23:46 UTC | |
|
Re: Push into an array inside a array
by BrowserUk (Patriarch) on Sep 12, 2010 at 00:23 UTC |