箭头便于标识变量的身份,这样我就可以很方便地看到他是一个指针。我觉得这种现象在标识符比较多的时候更明显一些。另外我觉得,用到指针的地方,还是不要太过省略箭头比较好吧~
2009/9/14 cnhack TNT <[email protected]> > 不明白这样表述哪里混乱? > > 2009/9/13 杨杰 <[email protected]> > > 各位前辈: >> >> 大家好!初学perl,最近新加入perlChina社区。目前遇到一个关于散列的引用问题如下: >> >> 对于一个散列的引用,如果要取出其中一个键的值,我们可以如下操作: >> my $ref_hash = {"a"=>1, "b"=>2, "c"=>3,}; >> >> 1. my $element = $$ref_hash{"a"}; >> 或 >> 2. my $element2 = $ref_hash->{"b"}; >> >> 但是我希望通过一个参数数组取出多个值,现在已经可以的是下面的用法: >> 1. my ($e1, $e2) = @$ref_hash{"a","b"}; >> >> 但毕竟这样表述比较混乱,请教前辈们是否可以通过指针方式达到这种(通过多个键获取对应值的数组的)效果?我用了很多种方法也不行~ >> >> 多谢指教! >> >> >> -- >> Yang Jie(杨杰) >> Group of MRMSS, Xi'an Jiaotong University >> Department of Computer Science and Technology, Xi’an Jiaotong University >> >> hi.baidu.com/thinkdifferent >> PHONE: 86 1346888 3723 >> TEL: 86 29 82665263 EXT. 24 >> MSN: [email protected] >> >> >> > > > > -- Yang Jie(杨杰) Group of MRMSS, Xi'an Jiaotong University Department of Computer Science and Technology, Xi’an Jiaotong University hi.baidu.com/thinkdifferent PHONE: 86 1346888 3723 TEL: 86 29 82665263 EXT. 24 MSN: [email protected] --~--~---------~--~----~------------~-------~--~----~ 您收到此信息是由于您订阅了 Google 论坛“PerlChina Mongers 讨论组”论坛。 要在此论坛发帖,请发电子邮件到 [email protected] 要退订此论坛,请发邮件至 [email protected] 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛 -~----------~----~----~----~------~----~------~--~---
