perlquestion
Cody Pendant
I think the title says it all, but:
<OL><LI> 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?
<LI>What if it gets four?
<LI>What's the correct position on whether it should <B>die</B>, <B>warn</B>, or just <B>return</B> an error message?
<LI>How detailed should the error message be? Should I say:<OL type="a"><LI>Wrong number of parameters! I need three!<LI>Wrong number of parameters! Correct syntax is my_sub($name,$phone,$address)<LI>Wrong number of parameters! Correct syntax is my_sub($name,$phone,[$address|@address]) -- for instance, if one of the parameters can be an array or a scalar<LI>Wrong number of parameters! Correct syntax is my_sub($name,$phone,$address)<LI>Wrong number of parameters! See documentation!</OL>
</OL>
Thanks.
<BR>
--
<BR>
<code>
($_='jjjuuusssttt annootthheer
pppeeerrrlll haaaccckkeer')=~y/a-z//s;print;</code>