my %register = ( "name" => "Wander", "name" => "Tison" );
print $register{ name }; # OUTPUT: Tison
所以为了合并散列(新散列覆盖旧散列,如果有交叉)可以使用下面两种写法
%old = ( %old, %new );
# or
@old{ keys %new } = values %new;
原文地址:https://www.cnblogs.com/wander4096/p/9498172.html
时间: 2024-10-30 11:01:32