in reply to Re: element of an array of arrays
in thread element of an array of arrays

So when I push arrays onto an empty array, that doesn't create an array of arrays ?

Interesting, that's not where I thought the problem was. Now I'm at a loss. How would I create an array of arrays with that data ?

Dyslexics Untie !!!

Replies are listed 'Best First'.
Re^3: element of an array of arrays
by frozenwithjoy (Priest) on Jun 17, 2013 at 02:24 UTC
    I just updated my answer w/ code that creates an AoA. You were basically pushing a list into an array and it gets incorporated into the array just like all the elements. What you needed to do was push an array reference.
Re^3: element of an array of arrays
by Anonymous Monk on Jun 17, 2013 at 03:09 UTC

    So when I push arrays onto an empty array, that doesn't create an array of arrays ?

    an array of arrays is an array of arrayrefs

    When you push @arra, @array you're pushing a list onto @arra

    push @arra, \@array; ## pushing arrayreference, array of arrays achieved

      perldoc -f push
      push ARRAY,LIST
      push EXPR,LIST
      Treats ARRAY as a stack by appending the values of LIST to the end of ARRAY. The length of ARRAY increases by the length of LIST.