Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: examples of exceptions gone wrong?

by betterworld (Curate)
on Aug 30, 2008 at 23:40 UTC ( [id://707965]=note: print w/replies, xml ) Need Help??


in reply to examples of exceptions gone wrong?

There are some situations where errors are not that fatal, or you even expect something to fail.

  • The MAX_TRIES loop in File::Temp: This tries some file names until open won't give EEXIST any more. Personally I often write code like this where I take advantage of the atomicity of system calls (e.g. use the fact that open tests for existence).
  • When you write a port scanner using connect calls.
  • This might qualify as well: Replace duplicate files with hardlinks (although something like "next" could be done with exceptions quite easily).

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others lurking in the Monastery: (3)
As of 2024-04-16 19:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found