Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Error handling - how much?

by Ultra (Hermit)
on Jun 12, 2005 at 19:55 UTC ( [id://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!

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2024-04-23 19:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found