in reply to Re^2: Question: Is undef a valid argument?
in thread Question: Is undef a valid argument?
Like I already said, $ARGV[0] always evaluates to a scalar. As long as you keep using $ARGV[0], you'll always get a scalar. If you want to pass zero when @ARGV is empty, you'll need to pass something different when @ARGV is empty. In general, you'd do
p1( @ARGV ? $ARGV[0] : () );
In this case, the following suffices:
p1(@ARGV);
|
|---|