in reply to How to print subarray of AOA?

That's not an array of arrays (or list of lists) at all. When you do:
push(@aroa, @arr);
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.

And the line:

print"$aroa[0][0]\n";
will just give you an error (if you are running under strict) as follows:
Can't use string ("a") as an ARRAY ref while "strict refs" in use at a +rr.pl line 9.
So...to get a LoL (list of lists), what you need to do is:
push(@aroa, [@arr]);
A couple of tips:

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
    There is something wrong!!!. In the example my line:
    push(@aroa, [@arr]);

    ..has been has written as:
    push(@aroa, @arr);

    The square brackets caused the text to become a link to nowere as you can see. Sorry for the confusion this has coused. I have not thought that I can create an array by push(@aroa, @arr); Maybee you could tell me how to do to write square brackets around an array and beeing able to see them in the final text. "print"@{$aroa[0]}\n";"
    Was the answer I was looking for.
    Are the other possibilities to write the same thing?
      Yes, use <code> tags, even around short pieces of code. It's still code after all.

        And, of course, you can use <c> tags instead of <code> tags, which makes it less of a pain for short pieces of code.

        -xdg

        Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.

      and to generalize on moklevat's CORRECT answer, please read Writeup Formatting Tips for more information on formatting posts, with special attention to the section on "Special characters" and the one below, re html tags.