in reply to Using number "0" as an input argument

Your problem is the part that says:   || ''.

In a test for truthiness, zero is False.   As demonstrated by these two one-liners:

perl -e 'my $foo="0"; print "\""; print ($foo || "X"); print "\" is th +e word.\n";' "X" is the word. perl -e 'my $foo=0; print "\""; print ($foo || "X"); print "\" is the +word.\n";' "X" is the word.

Just to make the foregoing abundantly clear:   the difference between the two examples is that, in the first, $foo is a string, while in the second, it is integer.   Perl silently performs the data-type conversion, regarding both as “zero.”   In both cases, Perl concludes that the value, being zero, is False.   Therefore, the expression ($foo || "X") evaluates to its right-hand side:   “X.”   Which is definitely not what you wanted.

I agree that you should be testing the number of arguments first, and die()ing with a message to the effect that the number is incorrect.   Then, if necessary, test the arguments against a regex pattern to be certain that each consists of one-or-more digits, giving another (different) message if this is not the case.   Do not test arguments for “truthiness” because, as you just found out, this relies on what the values actually are.   (Also do not rely on exists, because that does not care what they actually are.)

Several years from now, your successor’s successor’s successor ... who is trying to debug a process of which your script is a tiny part (until s/he, too, can get-the-hell out of there) ... will thank you for your diligence and attention to detail.   ;-)