You have two options: You can either iterate through the replacement key/value pairs and set the $hash{$key} = $value, or if your list of keys and values are known ahead of time, a hash slice might let you make a change to a group of hash entries with one statement (e.g. @hash{@new_keys} = @new_values).
In reply to Re: Re: adding to a hash
by Fastolfe
in thread adding to a hash
by powerhouse
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |