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


in reply to Re: better array to hash conversion
in thread better array to hash conversion

Many thanks for that. I find it very interesting that the 'for' loop is actually the second fastest solution, faster than the solutions using 'map'.

Replies are listed 'Best First'.
Re^3: better array to hash conversion
by space_monk (Chaplain) on Dec 11, 2012 at 19:34 UTC

    A for solution is generally faster than a map, and it has been discussed in map versus for amongst other places. Sometimes however it is more expressive to use "map".

    A Monk aims to give answers to those who have none, and to learn from those who know more.