1. regression list process
1.1 each line shall chop the "\t" and space in the beginning and end.
1.2 leave only one space between two words.
2. perl5:
2.1 perl5 support OOP with "package"
2.2 or比||优先级低
@info = stat($file) || die; # 等效于@info=(stat($file)) or die)
@info = stat($file) or die; # 等效于(@info=stat($file)) or die
2.3 ==返回是是否数值相等,eq返回的是字符相等
2.4 perl读取系统变量:$simdir = $ENV{'PROJ_SIM'};
2.5 our, my, local的区别
our明确声明一个"全局变量",
my只能本层模块或者函数可以看到这个变量,高一层的或者低一层的都看不到的,只能用作private,new, non-global variables,
local本层和本层下层的函数可以看到本层的变量,但是本层上一层的不可以
2.6 ', "的区别
单引号除了反斜字符和单引号外,单引号内所有字符都代表它们自己
双引号会将字符串内的变量名称替换成该变量当前的值,单引号不支持该特性
3. perl Module
3.1 module加载
use lib "$ENV{"PROJ_HOME"/bin"
use Module::Report;
$report = Report->new;
my $temp = $report->VERSION;
$report->gen($x);
#加载$PROJ_HOME/bin/module/Report.pm
3.2 module举例
package Report;
sub new {
my $class = shift;
my $self = {};
bless($self, $class};
return $self;
}
sub gen {
my ($self, $temp) = @_; #$temp是第一个参变量
...