语法上的野,没必要有这么多的追求吧?日本仔讲话的顺序同我们的都有不一样
啦,南方人讲话和北方人讲话习惯也会不同。 ;-)

wbi 畢 wrote:
> perl6 下 就改成
>
> @list[0] %hash{'aaa'} 合法 -- 个人觉得这样更合理些
>
> $list[0] $hash{'aaa'} 不合法
>
> ------------------------------------------------------------------------
>
> Date: Fri, 16 Jan 2009 09:03:03 +0800
> From: [email protected]
> To: [email protected]
> Subject: [PerlChina] Re: perl标量与列表和散列的一点疑问
>
> 不是大家说的,是我说的:larry说要这样做的。^_^!
>
> e280s wrote:
>
>     首先声明:这只是我的一点认识,不是来招口水的,也不涉及到perl的优劣。
>
>     1. 我建立一个列表:
>     @list = qw/aaa bbb ccc ddd/;
>
>     我想使...@list中的aaa,于是我可以使用:
>     @list[0]或$list[0]
>
>     2. 我建立一个散列:
>     %hash = (
>         'aaa' => 'aaaa',
>         'bbb' => 'bbbb',
>         'ccc' => 'cccc'
>     );
>     我想使用aaaa,于是:
>     $hash{'aaa'}即可。但是%hash{'aaa'}就是一个错误的用法。
>
>     疑问:是不是设计的时候设计使...@list[下标]的方式是多余的啊,而对散列没有这样一个类似的用法。
>
>     我估计大家又该说了:larry说要这样做的。^_^!
>
>     呵呵。
>
>
>       
>
>
>
> -- 
> Perl乐事 -- http://www.perlersh.org <http://www.perlersh.org/>
>   
>
>

-- 
Perl乐事 -- http://www.perlersh.org


--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛“PerlChina 论坛”论坛。
 要在此论坛发帖,请发电子邮件到 [email protected]
 要退订此论坛,请发邮件至 [email protected]
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛
-~----------~----~----~----~------~----~------~--~---

回复