Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Generate Array of Hashes WITHOUT References

by ikegami (Patriarch)
on Sep 09, 2014 at 05:04 UTC ( [id://1099936]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1099936]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (4)
As of 2024-04-18 03:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found