Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW

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
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 browsing the Monastery: (6)
As of 2015-11-29 04:29 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (746 votes), past polls