免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1996 | 回复: 4
打印 上一主题 下一主题

关于 subroutine private to a package 的问题 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-06-04 05:31 |只看该作者 |倒序浏览
In which one of the following ways is a subroutine made private to a particular package?  
Choice 1   
By placing ($$) after the name of the subroutine in the subroutine declaration  
Choice 2   
By placing ($) after the name of the subroutine in the subroutine declaration  
Choice 3   
By prefixing the declaration with the private keyword  
Choice 4   
By creating a locally-scoped reference to an anonymous subroutine  
Choice 5   
By adding the subroutine's name to

哪一个是正确的?
好像Choice 4 可以吗?那么说就是可以用个local 引用指向的匿名子程序?
找到了一点线索从网上如下:
SUBROUTINE can be an expression yielding a reference to code. In this case you can use &${EXPR}([LIST]) or ${EXPR}->([LIST]).

http://66.102.7.104/search?q=cac ... mp;ct=clnk&cd=2

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
2 [报告]
发表于 2006-06-04 08:07 |只看该作者
locally-scoped reference 指的是 my 声明的引用。
像这样:

  1. my $method = sub {
  2. # ......
  3. };
复制代码

论坛徽章:
0
3 [报告]
发表于 2006-06-04 13:52 |只看该作者

回复 2楼 flw 的帖子

那么哪个选项是正确的?

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
4 [报告]
发表于 2006-06-04 14:27 |只看该作者

原来你是要让我帮你做题。

论坛徽章:
0
5 [报告]
发表于 2006-06-04 15:51 |只看该作者

回复 4楼 flw 的帖子

有疑难请高手解惑嘛。是个BrainBench的题,听过吗?

不要晕倒,还仰仗老大呢。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP