主页 > 知识库 > perl中的$a和$b介绍

perl中的$a和$b介绍

热门标签:上海企业外呼系统 万利达百货商场地图标注 智能机器人电销神器 河南虚拟外呼系统公司 外呼电信系统 电话机器人哪里有卖 okcc外呼系统怎么调速度 惠州龙门400电话要怎么申请 热门电销机器人

即使打开了strict和warnings选项也无妨,下面代码并无错误和警告。

复制代码 代码如下:

#!/usr/bin/perl
use strict;
use warnings;
sub test {
    $a = 1;
    $b = 2;
    print $a, "\n";
    print $b, "\n";
}
test();
1;


下面是perl文档中对这两个变量的解释:

perldoc perlvar
$a
$b Special package variables when using sort(), see "sort" in perlfunc. 
Because of this specialness $a and $b don't need to be declared (using use vars, or our()) even when using the "strict 'vars'" pragma.  Don't lexicalize them with "my $a" or "my $b" if you want to be able to use them in the sort() comparison block or function.

标签:周口 绥化 合肥 百色 淮安 秦皇岛 周口 绵阳

巨人网络通讯声明:本文标题《perl中的$a和$b介绍》,本文关键词  perl,中的,和,介绍,perl,中的,;如发现本文内容存在版权问题,烦请提供相关信息告之我们,我们将及时沟通与处理。本站内容系统采集于网络,涉及言论、版权与本站无关。
  • 相关文章
  • 下面列出与本文章《perl中的$a和$b介绍》相关的同类信息!
  • 本页收集关于perl中的$a和$b介绍的相关信息资讯供网民参考!
  • 推荐文章