use strict; my $var = NULL;
将引发错误的Bareword“NULL”不允许同时使用“严格subs”
undef
my $var; # variables are undefined by default undef $var; # undef() undefines the value of a variable $var = undef; # same,using an alternative Syntax
要检查变量的定义,使用defined(),即
defined()
print "\$var is undefined\n" unless defined $var;