Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Adding values from an array to a hash

by blazar (Canon)
on Oct 12, 2006 at 10:29 UTC ( [id://577799] : note . print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


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