in reply to How to print subarray of AOA?
all you are doing is pushing the contents of @arr into @aroa. And because @aroa is previously empty, what you have done is just made a copy of @arr.push(@aroa, @arr);
And the line:
will just give you an error (if you are running under strict) as follows:print"$aroa[0][0]\n";
So...to get a LoL (list of lists), what you need to do is:Can't use string ("a") as an ARRAY ref while "strict refs" in use at a +rr.pl line 9.
A couple of tips:push(@aroa, [@arr]);
Cheers,
Darren :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How to print subarray of AOA?
by tamaguchi (Pilgrim) on Apr 09, 2006 at 13:57 UTC | |
by moklevat (Priest) on Apr 09, 2006 at 14:08 UTC | |
by xdg (Monsignor) on Apr 09, 2006 at 16:51 UTC | |
by ww (Archbishop) on Apr 09, 2006 at 14:47 UTC |