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

Re^4: eval to replace die?

by mjscott2702 (Pilgrim)
on Oct 05, 2010 at 08:33 UTC ( #863540=note: print w/ replies, xml ) Need Help??


in reply to Re^3: eval to replace die?
in thread eval to replace die?

Wow, I opened up a whole can of worms there. What I was trying to point out was simply this - sometimes, it doesn't matter WHY something went wrong, just to die gracefully with some informative message e.g. File Not Found.

In the case of a simple script that is trying to parse a file that it can't access (permissions, missing file etc), there is nothing to recover from - give the user some clue as to what went wrong, and terminate.

Obviously, there are situations where the script/application/program shouldn't exit - trap the error, display the error message, log it and continue.

The use of eval, catching exceptions, trapping signals etc is the choice of the programmer - TMTOWTDI.

And yes, that might mean some fuzzy string comparisons.... :)


Comment on Re^4: eval to replace die?

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (6)
As of 2015-07-03 23:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls