but should have done%locations = map{ $_ => 1 } ( @locations );
Now I think that this setup is really annoying, easpecially as I would like rewrite it so that every value is counted to represent how often a location has been added. Is there a way to add onto the old hash instead of completely rewriting it?%locations = map{ $_ => 1 } ( @locations, keys %locations );
In reply to Adding values from an array to a hash by PerlingTheUK
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |