将两个哈希值合并到%hash1的最佳方法是什么?我总是知道%hash2和%hash1总是有唯一的密钥.如果可能的话,我也更喜欢一行代码.
$hash1{'1'} = 'red'; $hash1{'2'} = 'blue'; $hash2{'3'} = 'green'; $hash2{'4'} = 'yellow';
perl hash merge dictionary
dictionary ×1
hash ×1
merge ×1
perl ×1