in reply to How does one construct and access an array of arrays?
That's basically what you're doing, except for this line:$AoA[$row][$col] = $col;
This code causes @AoA itself to be a copy of the array referenced by $firstRow. Since an array of arrays needs to be an array of array references, this is not what you want. Get rid of that line, or possibly change it to:push(@AoA, @$firstRow);
push(@AoA, $firstRow);
Also, in your bless statement, you need to change @AoA to \@AoA. Again, nested data structures need to use references. Try making those changes, and see if it works more as you expect.
Oh yeah, and you may also find these man pages helpful: perlref, perldsc, perllol.
|
|---|