in reply to How to assign a hash from an array?

i suggest you use warnings; or #!perl -w which would have caught your re-declaration of the $key variable, and your declaration of $value1 without using it (you probably meant $value.)

otherwise, your use of map is correct. but you also seem to be confused about variable scoping. in that case, Coping with scoping (or anything on Dominus's home node) may be a good read.

it's good practice, during development, to put the following block in every perl script:

#!/usr/local/bin/perl -w use strict; use diagnostics; $|++;
of course, you'll replace '/usr/local/bin/perl' with the location of your perl executable. this will turn on the warnings, strict, and diagnostics pragmas, which will enforce some good coding practices, and make code easier to debug. for more info, read Use strict warnings and diagnostics or die. also, $|++ will unbuffer your output to STDOUT, which means printing will be timely.

~Particle ;Þ