Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
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.

Replies are listed 'Best First'.
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (5)
As of 2016-12-03 12:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (56 votes). Check out past polls.