in reply to Generate Array of Hashes WITHOUT References
Elements of arrays are scalars. You cannot store a hash in $a[0] any more than you could in $x.
That said, you could delay creating the reference until the last moment, if that's what you're looking for.
push @AoH, \%rec;
Update: Made the answer more complete by adding the second half.
|
|---|