note
mwah
<p>An additional (interesting?) question would be: how can I create an AoA on a hash key 'in place', for example I want to create a 10x10 boolean array that is located in a hash under a specific key, e.g.:</p>
<c>
# example: build a 10x10 boolean field on a hash key
my $key='10x10';
my %hash;
for my $row (0..9) {
for my $col (0..9) {
push @{
$hash{$key}[$row]
},
int(rand()+0.5);
}
}
</c>
<p>Afterwards, we could run through our array by iteration over indexes:</p>
<c>
for my $row (0..9) {
for my $col (0..9) {
print "{$key} => [$row][$col] = $hash{$key}[$row][$col] \n"
}
}
</c>
<p>Regards</p>
<p>mwa</p>
687359
687359