$nargs = @ARGV;
or do this:
$nargs = $#ARGV + 1;
In reply to Re: Count the number of parameters by Anonymous Monk in thread Count the number of parameters by Massyn