Spoke too soon.
None of what you sggested works.
Try passing nothing to the script you will see it still states one argument.#! /usr/bin/perl use strict; use warnings; sub p1 { my $n1; $n1=scalar(@_); if (@_) { print "Has elements\n"; } print "1. Parameters to the sub p1 $n1\n"; my $p1=shift; if (@_) { print "Has elements\n"; } else { print "Has no elements\n"; } print "2. p1=$p1\n"; } p1 $ARGV[0];
In reply to Re^2: Question: Is undef a valid argument?
by jujiro_eb
in thread Question: Is undef a valid argument?
by jujiro_eb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |