XP is just a number | |
PerlMonks |
Re: What Are The Rules For Subs And Modules When Fed Wrong Inputby perrin (Chancellor) |
on Jul 21, 2002 at 05:03 UTC ( [id://183778]=note: print w/replies, xml ) | Need Help?? |
You should die so that the person who wrote the incorrect code can find out about the error. Since it's a module, use the Carp module's croak() method instead of die, and that will improve the value of the error message. Also, be sure to document this behavior so that users of your module have an opportunity to catch the error with an eval block if they need to.
In Section
Seekers of Perl Wisdom
|
|