perl 中$::的含义及用法

如题,谢谢... 如题,谢谢 展开
百度网友d580670
2014-02-12 · TA获得超过1983个赞
知道大有可为答主
回答量:2054
采纳率:82%
帮助的人:703万
展开全部
While the :: symbol can be thought of as similar to the period in a C struct, it is much more akin to the :: class scope operator in C++: a.b.c; /* something in C */ a::b::c(); // function in C++ $a::b::c; # a scalar in Perl 5 @a::b::c; # a list in Perl 5 %a::b::c; # an associative array or "hash" in Perl 5 &a::b::c; # a function in Perl 5
 “::”符号可以认为是与C语言中的“.”相似,而它更像C++中的::类范围操作符。
$m = 5;
sub me
{
}
$main::m
&main::me
...
追问
so does it mean $:: equals $main::?
追答
不是啊,可以加任意的闭包名称的,默认的话变量是在main的闭包里面
百度网友c9e795dda
2014-02-13 · TA获得超过5167个赞
知道大有可为答主
回答量:1128
采纳率:0%
帮助的人:1151万
展开全部
I never seen this before, I only know about $: but not $::, where you saw this ? Could you put up some quote / source code ?
追问
May we can talk about this with another way,send me a message to the adress 25866785@qq.com,I will send you the source code.

I am sorry but I don't like put the code source here
追答
Got it. added yr Q.
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式