I'm trying to create a 3 dimensional array
I've done two dimensionals.. (just a snipit for printing it)
But the three dimensionals seem beyond me. This piece is supposed to pull items off of some input $_ one buy one and push them one by one to a different array (thats inside of an array called column, thats inside of an array called row)@nine = (0,1,2,3,4,5,6,7,8); foreach $row (@nine) { foreach $column (@nine) { print "$matrix[$row][$column]"; } print "\n"; }
I had the two dimensional version pulling one by one off of $_ and assigning them to the elements in $matrix$row$column and that worked fine.
foreach $row(@nine) { foreach $column(@nine) { s/\d//; push(@matrix[$row][$column], $&); } }
Basically I want a 9 by 9 matrix that hold an array instead of just a scaler.
I can implement the array I want well enough the long way.. But as you see in my horrible code, I don't have the knowledge required to reference it.
Oh please, mighty perl monks, lend me your knowledge so that I might continue on my perl journey
In reply to Multi-dimensional arrays... by nothign
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |