In the perl, how to reference values in the array of hashmap ? for example,
my %person1 = (
id => 3,
name=> 'George',
age => 29,
);
my %person2 = (
id => 3,
name=> 'George',
age => 29,
);
my @persons = ( \%person1, \%person2 );
print $persons[0]->id; #wrong
You need to indicate that
idis a hash key. Try