更新时间:2023-11-28 19:04:22
因为它不是 Perl.你从哪里学的那个语法?它有很多问题.
Because it's not Perl. Where did you learn that syntax? So much is wrong with it.
$param = ""
给 $param
分配一个空字符串,这不是你想要的.
$param = ""
assigns an empty string to $param
, that's not what you want.
null 拼写为 undef
在 Perl 中.
null is spelled undef
in Perl.
要比较字符串,请使用 eq
运算符.
To compare strings, use the eq
operator.
您必须引用字符串:打印无参数"
更容易:
#!/usr/bin/perl
if (@ARGV) {
print 'have parameters';
} else {
print q{don't have parameters};
}