if ( ! defined $var ) {
print "not defined\n";
}
else {
print "defined\n";
}
來源 : http://www.unix.com/shell-programming-scripting/38416-not-null-cheking-argument-perl.html
if ( ! defined $var ) {
print "not defined\n";
}
else {
print "defined\n";
}
沒有留言:
張貼留言