in reply to How to assign a hash from an array?
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:
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.#!/usr/local/bin/perl -w use strict; use diagnostics; $|++;
~Particle ;Þ
|
|---|