Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Error handling - how much?

by Ultra (Hermit)
on Jun 12, 2005 at 19:55 UTC ( #465997=note: print w/ replies, xml ) Need Help??


in reply to Error handling - how much/where/how?

I can only agree with salva. Wrapping every sentence in eval will not only slow down your entire program, but it will obfuscate it to the point of no return.
Instead, I think it's more useful to be aware of certain situations prone to generating errors.
Here's an incomplete list:
* use strict and warnings for typos and common mistakes
* check the user's input using regular expressions (taint check is a big helper here)
* be careful about arithmetic operations (divide by zero etc.)
* check the return of the system calls and generally the retun values of all the functions you use (including yours), and when you can't continue, throw a useful message so that the user can easily spot the problem and eventualy contact you if it is the case...

I don't think it's a matter of "how much" but of "when and how" to check for possible errors.

Dodge This!


Comment on Re: Error handling - how much?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2014-10-22 01:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (112 votes), past polls