Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses

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?

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2015-11-28 06:54 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (739 votes), past polls