- or download this
foreach my $d (@{$array_of_hashes}) {
print $d[0]{'one1'};
}
- or download this
foreach my $h (@{$array_of_hashes}) {
print $h->{'one1'};
}
- or download this
print $array_of_hashes[0]{'one1'};
print $array_of_hashes[0]{'one2'};
print $array_of_hashes[1]{'two1'};
print $array_of_hashes[1]{'two2'};
- or download this
print $array_of_hashes->[0]{'one1'};
print $array_of_hashes->[0]{'one2'};
print $array_of_hashes->[1]{'two1'};
print $array_of_hashes->[1]{'two2'};
- or download this
my %hash;
my @array;
...
push @array, \%hash;
...
push @array, \%hash;
- or download this
my @array;
{
...
...
push @array, \%hash;
}