in reply to Multi-dimensional arrays...
Basically I want a 9 by 9 matrix that hold an array instead of just a scaler.
for my $row (0..8) { for my $col (0..8) { my @record = ...; $data[$row][$col] = \@record; } }
If the above "..." is built using a loop, you can avoid the intermediary variable @record:
for my $row (0..8) { for my $col (0..8) { for my $x (...) { push @{ $data[$row][$col] }, $x; } } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Multi-dimensional arrays...
by nothign (Novice) on May 31, 2009 at 18:38 UTC | |
by johngg (Canon) on May 31, 2009 at 19:12 UTC | |
by nothign (Novice) on May 31, 2009 at 19:54 UTC |