How can I distinguish between an argument that was not passed and one that was passed with a false value?
问题 I am trying to figure the best way to differeniate in Perl between cases where an argument has not been passed, and where an argument has been passed as 0, since they mean different things to me. (Normally I like the ambiguity, but in this case I'm generating SQL so I want to replace undefined args with NULL, but leave 0 as 0.) So this is the ambiguity: sub mysub { my $arg1 = shift; if ($arg1){ print "arg1 could have been 0 or it could have not been passed."; } } And so far, this is my best