http://www.perlmonks.org?node_id=1008289


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;