in reply to better array to hash conversion
The following code does this, but I wonder if there is a more elegant and/or efficient way of doing this?
Really? What search terms did you use to look?
Did you benchmark?
my %hash; @hash{ @array } = 0 .. $#array;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: better array to hash conversion
by perltux (Monk) on Dec 11, 2012 at 12:35 UTC | |
by Anonymous Monk on Dec 11, 2012 at 13:11 UTC |