Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Dear Monks, I was wondering if you can help me understand why this code does not work:
use strict; use warnings; my @AoA_delta_table = [ ['0','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0',' +0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0 +','0','0','0'], ['0','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0',' +0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0 +','0','0','0'], ['0','1','1','0','0','0','0','0','0','0','0','0','0','0','0','0','0',' +0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0','0 +','0','0','0'] ]; for my $i ( 0 .. $#AoA_delta_table ) { for my $j ( 0 .. $#{$AoA_delta_table[$i]} ) { print "element $i $j is $AoA_delta_table[$i][$j]\n"; } }

it prints:
element 0 0 is ARRAY(0x1706998) element 0 1 is ARRAY(0x1745880) element 0 2 is ARRAY(0x1742368)

I also tried without the quotes, since I thought it would be ok since my AoA is composed only of numerical arrays, but I get the same result...

Replies are listed 'Best First'.
Re: why can't I print my array of arrays properly?
by Anonymous Monk on Jul 16, 2014 at 23:21 UTC
    Oups! Missed the () instead of [] in the assignment of the AoA... Newbie mistake!!