[oracle@dwh1 ~]$ cat 4.pl
if ($#ARGV <0){
print "请输入一个表名参数";
print "$#ARGV is $#ARGV
";
exit(-1);
}else{
print "$#ARGV is $#ARGV
";
}
[oracle@dwh1 ~]$ perl 4.pl
请输入一个表名参数$#ARGV is -1
$#ARGV 参数个数减去1 ,0个参数减去1 就是-1
[oracle@dwh1 ~]$ perl 4.pl 1
$#ARGV is 0