Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Array of hashes misbehaving?

by Eliya (Vicar)
on May 23, 2012 at 22:22 UTC ( #972114=note: print w/ replies, xml ) Need Help??


in reply to Array of hashes misbehaving?

This fixes the problem: ...

Actually, in this particular case, you could also just not initialize the array, i.e. simply say

my @hashes; $hashes[$_]{$_} = 1 foreach (0 .. 9);

and let autovivification do the job.


Comment on Re: Array of hashes misbehaving?
Download Code
Re^2: Array of hashes misbehaving?
by Dr. Mu (Hermit) on May 23, 2012 at 22:58 UTC
    Good point. Thanks for the reminder!

    -Phil

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (10)
As of 2015-07-06 08:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (70 votes), past polls