Sanyal, Dibya F (Corporate, consultant) <[EMAIL PROTECTED]>
wrote:
>:
>: I have 2 arrays. One holds all uniq key values of an
>: associative list (all ssn), other holds the associated
>: values (their names). I need to create a hash by
>: putting these arrays together. Each entry in that hash
>: would be (ssn => name).
>: 
>: I can iterate over one array and create the hash. Is
>: there any inbuilt function (or a real cool piece of
>: code) that does the same?

>    Nothing all that cool. You need a hash slice:

>my %hash;
>@hash{ @ssn } = @names;

Thanks a lot. Both the hash slice and map function works good. I guess I would stick 
to hash slice :)

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to