Perl: the Markov chain saw | |
PerlMonks |
Re: What Are The Rules For Subs And Modules When Fed Wrong Inputby dws (Chancellor) |
on Jul 21, 2002 at 04:15 UTC ( [id://183765]=note: print w/replies, xml ) | Need Help?? |
If I've written a sub or module which expects, say, three variables to be passed to it, what should it do when it gets two?
Consider CGI.pm as an exemplar. Return undef if an argument is missing and you can't substitute a reasonable default. die as a last resort.
In Section
Seekers of Perl Wisdom
|
|