Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery

Re: Re: Re: CGI Error Handling

by edebill (Scribe)
on Dec 11, 2001 at 10:10 UTC ( #130872=note: print w/ replies, xml ) Need Help??

in reply to Re: Re: CGI Error Handling
in thread CGI Error Handling

In your example, the second option is actually more readable. But if the function call on the left is longer, and you start wrapping things will get pretty ugly. What's more, if you do something like $sth->execute and the transaction fails (e.g. from bad SQL or an RI constraint) $sth->execute will call die() for you - and an eval block is the only way to catch it.

I prefer to use the same method for something every time - so I go for nothing but eval blocks. Using two different constructs to do the same thing in the same bit of software just makes things harder to maintain. YMMV.

Comment on Re: Re: Re: CGI Error Handling

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (5)
As of 2015-11-28 00:09 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 (735 votes), past polls