$hash1{$_} = $hash2{$_} for keys %hash2;
You can also use a hash slice:
@hash1{keys %hash2} = values %hash2;
In reply to Re: update a hash with a hash
by friedo
in thread update a hash with a hash
by stupidius
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |