个人认为 given、when没啥用,就是写的好看些 用if elsif , else 一样的
2011/7/19 Shu Cao <[email protected]> > given/when是从Perl6“偷”来的。至于为什么,S04[1]有说: > > "A switch statement is a means of topicalizing, so the switch keyword is > the English topicalizer, given. The keyword for individual cases is when" > > [1]: http://perlcabal.org/syn/S04.html#Switch_statements > > 2011/7/16 Beckheng Lam <[email protected]> > >> 以上是其一,另一个是为何Perl在这么多年以后,**才决定加入这个风格的语句呢? >> >> -- >> 我的博客 -- http://blog.yixinit.com/ >> 诸法从缘起,如来说是因。 >> 彼法因缘尽,是大沙门说。 >> >> >> -- >> 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。 >> 要向此网上论坛发帖,请发送电子邮件至 [email protected]。 >> 要取消订阅此网上论坛,请发送电子邮件至 >> perlchina+unsubscribe@**googlegroups.com<perlchina%[email protected]> >> 。 >> 若有更多问题,请通过 >> http://groups.google.com/**group/perlchina?hl=zh-CN<http://groups.google.com/group/perlchina?hl=zh-CN>访问此网上论坛。 >> >> > > > -- > Shu Cao > > -- > 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。 > 要向此网上论坛发帖,请发送电子邮件至 [email protected]。 > 要取消订阅此网上论坛,请发送电子邮件至 [email protected]。 > 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。 > -- Yours Sincerely Zeng Hong -- 您收到此邮件是因为您订阅了 Google 网上论坛的“PerlChina Mongers 讨论组”论坛。 要向此网上论坛发帖,请发送电子邮件至 [email protected]。 要取消订阅此网上论坛,请发送电子邮件至 [email protected]。 若有更多问题,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问此网上论坛。
