How else would you (recommend) check for passed arguments to be present if this does not work?
I would either pass the content of @ARGV or a reference to it myself:
use strict; use warnings; mysub1(@ARGV); mysub2(\@ARGV); exit(0); sub mysub1 { my @args = @_; print "There were " . scalar(@args) . " arguments: @args\n"; } sub mysub2 { my ($args) = @_; print "There were " . scalar(@$args) . " arguments: @$args\n"; }
In reply to Re: Question: Is undef a valid argument?
by ig
in thread Question: Is undef a valid argument?
by jujiro_eb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |