- 论坛徽章:
- 6
|
本帖最后由 stanley_tam 于 2013-10-09 17:08 编辑
- "$flintstones[4]" => {
- "$husband[4]" => [ 44fred, 441, 4222, 43 ],
- "$wife[4]" => [ 4barney, 41, 42, 43555 ],
- },
复制代码 44fred和4barney会语法错误,数字开头。。。44fred和4barney得用引号。
话说,有胖箭头( => ) 的话,左边不要用引号,
用循环为哈希加键/值? 直接赋值貌似更容易点{:3_189:}- $HoH{$flintstones[4]}->{$husband[4]} = [ '44fred', 441, 4222, 43 ];
- $HoH{$flintstones[4]}->{$wife[4]} = [ '4barney', 441, 4222, 43 ];
复制代码 循环赋值{:3_202:} ?:- for my $hash_ref (+{$husband[4] => [ '44fred', 441, 4222, 43 ]}, +{$wife[4] => [ '4barney', 441, 4222, 43 ]}){
- $HoH{$flintstones[4]} = $hash_ref;
- }
复制代码 回复 12# fjndhjf
|
|