in reply to Array of hashes misbehaving?

If I were to use map, I wouldn't use

my @hashes = map { {} } 0..9; $hashes[$_]{$_} = 1 for 0..9;

I would use

my @hashes = map { { $_ => 1 } } 0..9;

Replies are listed 'Best First'.
Re^2: Array of hashes misbehaving?
by Dr. Mu (Hermit) on May 23, 2012 at 22:57 UTC
    In my minimalistic example, used to illustrate the problem I was having, that would certainly work. But in the real program which spurred my example, it would not.

    But thanks just the same!
    -Phil