Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
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!

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://465997]
help
Chatterbox?
[Lady_Aleena]: Corion, I knew that, I was just giving Discipulus a hard time.
choroba likes the story at the end of the node
[choroba]: reminds me of the days at the bank
[Corion]: Lady_Aleena: Hehe ;-D
[Lady_Aleena]: Corion, it was PerlMonks who kept pushing me to get Linux, so now I know some of the commands to use in word play.
[Corion]: Lady_Aleena: :-D

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (8)
As of 2017-04-26 08:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (471 votes). Check out past polls.