Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Adding values from an array to a hash

by PerlingTheUK (Hermit)
on Oct 12, 2006 at 10:08 UTC ( [id://577794] : perlquestion . print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    %locations = map{ $_ => 1 } ( @locations );
    
  2. or download this
    %locations = map{ $_ => 1 } ( @locations, keys %locations );