Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things
 
PerlMonks  

Re: What Are The Rules For Subs And Modules When Fed Wrong Input

by perrin (Chancellor)
on Jul 21, 2002 at 05:03 UTC ( #183778=note: print w/replies, xml ) Need Help??


in reply to What Are The Rules For Subs And Modules When Fed Wrong Input

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.
  • Comment on Re: What Are The Rules For Subs And Modules When Fed Wrong Input

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://183778]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2020-04-03 07:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The most amusing oxymoron is:
















    Results (26 votes). Check out past polls.

    Notices?