On Thu, 17 May 2001, John Storms wrote:
> Is it possible to have an array of associative arrays?
Sure. Just stick hashrefs into each array element:
my @array = (
{ name => 'Jim', location => 'Buffalo' },
{ name => 'Bill', location => 'Boston' }
);
Then you can do
foreach $i (@array) {
print "$i->{name}\n";
print "$i->{location}\n";
}
-- Brett
- Arrays of hashes? John Storms
- Re: Arrays of hashes? David H. Adler
- Re: Arrays of hashes? Paul
- Re: Arrays of hashes? M.W. Koskamp
- Brett W. McCoy
