有人能解释一下这行代码的含义吗?
完整的代码如下,原本是用来输出输入内容的。
elsif ($ARGV[0] !~ /^\d+$/
完整的代码如下,原本是用来输出输入内容的。
if (@ARGV != 2) {
print "Usage: ./echon.pl <number of lines> <string>\n";
exit;
} elsif ($ARGV[0] !~ /^\d+$/) {
print "./echon.pl: argument 1 must be a non-negative integer\n";
exit;
}
$i=0;
while ($i < $ARGV[0]) {#print argv[1] for argv[0] - 1 times
print "$ARGV[1]\n";
$i++;
}