2009年9月6日星期日

[PerlChina] Fwd: 好久没摸Perl的语法了,这个语法把我给难倒了



---------- Forwarded message ----------
From: Mike.G <hylinux@gmail.com>
Date: 2009/9/7
Subject: 好久没摸Perl的语法了,这个语法把我给难倒了
To: china-pm@pm.org


好久没模Perl的语法了。
在看attributes的文档的时候一直出现这个语法,
比较郁闷。
哪位提点一下:

           use attributes ();
           my ($x,@y,%z);
           attributes::->import(__PACKAGE__, \$x, 'Bent');
           attributes::->import(__PACKAGE__, \@y, 'Bent');
           attributes::->import(__PACKAGE__, \%z, 'Bent');
           ($x,@y,%z) = 1;


第一个地方:
attributes::这个写法是省略了什么来着?
第二个地方:
import
我记得是在use的时候自动的调用module的import方法是不是?(例如module require Exporter), 这样就有了一个缺省的import方法
但是问题是attributes哪儿定义了这个方法呢?

请各位指点。

谢谢

Mike.G


--~--~---------~--~----~------------~-------~--~----~
您收到此信息是由于您订阅了 Google 论坛"PerlChina Mongers 讨论组"论坛。
 要在此论坛发帖,请发电子邮件到 perlchina@googlegroups.com
 要退订此论坛,请发邮件至 perlchina+unsubscribe@googlegroups.com
 更多选项,请通过 http://groups.google.com/group/perlchina?hl=zh-CN 访问该论坛

-~----------~----~----~----~------~----~------~--~---

没有评论: