国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 編程 > Perl > 正文

perl中的$a和$b介紹

2020-06-04 20:29:56
字體:
來源:轉載
供稿:網友

即使打開了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.

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 金阳县| 澎湖县| 新余市| 澄城县| 清涧县| 滕州市| 永州市| 秦皇岛市| 中牟县| 清苑县| 景洪市| 五峰| 阿合奇县| 南投市| 庐江县| 敦煌市| 阜城县| 吉林市| 扎兰屯市| 阳城县| 霍州市| 吉木乃县| 仙桃市| 五原县| 汝南县| 昌江| 威远县| 阿图什市| 赤峰市| 萨嘎县| 宜春市| 新巴尔虎右旗| 玉环县| 静乐县| 民权县| 开化县| 罗平县| 渭源县| 邢台县| 元朗区| 集贤县|