perl 中$::的含义及用法

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/09 05:58:28
perl 中$::的含义及用法

perl 中$::的含义及用法
perl 中$::的含义及用法

perl 中$::的含义及用法
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
...

I never seen this before, I only know about $: but not $::, where you saw this ? Could you put up some quote / source code ?