Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

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!


Log In?

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2016-10-24 03:27 GMT
Find Nodes?
    Voting Booth?
    How many different varieties (color, size, etc) of socks do you have in your sock drawer?

    Results (302 votes). Check out past polls.