in reply to Re^2: Anonymous Reference???
in thread Anonymous Reference???

This is incorrect. In this code:

my @a = ((1,2,3), (4,5,6));

... there is only one array: @a. Everything else is a list. Lists are not arrays; lists and arrays behave very differently in various contexts, for example.

The parentheses in the expression are for grouping to change the precedence of the right-side of the assignment, not to create lists (and especially not to create arrays).

Replies are listed 'Best First'.
Re^4: Anonymous Reference???
by sk (Curate) on Sep 12, 2005 at 04:38 UTC
    From this thread Scalars, Lists, and Arrays guess that is called a list expression and not a list itself. :)

    I think pg's example could have been something like this -  my @a = (1,2,3); my @b = (@a,4,5,6); here we use an array a in creating another array b. I think this just demonstrates that one can use arrays to create other arrays (you don't always need scalars separated by commas)...However I would not use the phrase arrays can contain arrays because once the array a is flattened under the list context the final array b just contains scalars

    In short I agree with halley.