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;
In reply to Re: better array to hash conversion
by Anonymous Monk
in thread better array to hash conversion
by perltux
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |