in reply to Populating a hash from array

This is known as a hash slice:
my %hash; @hash{@array1} = @array2;
The key is to declare the hash first, then apply the slice.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re: Re: Populating a hash from array
by TASdvlper (Monk) on Jan 05, 2004 at 21:48 UTC
    thanks ... I remember reading about hash slices but, until now, never had a need to use them.