Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: CGI Error Handling

by Lucky (Scribe)
on Dec 10, 2001 at 17:13 UTC ( #130649=note: print w/ replies, xml ) Need Help??


in reply to CGI Error Handling

The simplest way to handle errors is eval block. It acts like java try{}catch{} statement. For example:

eval{ ...code...}; if ($@) { handle error }
For complex error handling Error.pm module exists. It's very useful for scripts with an object-oriented structure. Example:
use Error; try{ do something... }catch Error::Simple with{ handling... }finally{ ... }
Looks like Java code :-)


Comment on Re: CGI Error Handling
Select or Download Code
Re: Re: CGI Error Handling
by davorg (Chancellor) on Dec 10, 2001 at 17:37 UTC
    Looks like Java code

    You say that like it's a good thing :)

    --
    <http://www.dave.org.uk>

    "The first rule of Perl club is you do not talk about Perl club."
    -- Chip Salzenberg

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (5)
As of 2014-09-21 04:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (166 votes), past polls