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

Re^4: improve ugly flow control

by dragonchild (Archbishop)
on Sep 26, 2004 at 15:46 UTC ( #393961=note: print w/ replies, xml ) Need Help??


in reply to Re^3: improve ugly flow control
in thread improve ugly flow control

My understanding of the OP's question was that this wasn't a "soft failure" situation. This was an out-and-out "Bad Thing"™ kind of failure. Exceptions aren't for everyone - this is true. However, a recommended method of working with DBI is to use RaiseError and eval/$@ blocks.

The reason to defer to a function is that this method can now be used by multiple scripts / modules in multiple situations, providing the same handling in all installs for a given company. "Efficient" can mean multiple things. In my case, I look for efficiency in developer time. I am almost always less concerned with CPU/RAM efficiency1, because they almost always cost less than the equivalent developer time.

  1. Except, of course, in the pathological case where the tradeoff is grossly prejudiced against the hardware. It's a standard maximization problem that all first-year calculus students learn to solve.

------
We are the carpenters and bricklayers of the Information Age.

Then there are Damian modules.... *sigh* ... that's not about being less-lazy -- that's about being on some really good drugs -- you know, there is no spoon. - flyingmoose

I shouldn't have to say this, but any code, unless otherwise stated, is untested


Comment on Re^4: improve ugly flow control

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others imbibing at the Monastery: (15)
As of 2014-08-28 16:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (264 votes), past polls