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

Style Point: Catching eval { } errors

by hardburn (Abbot)
on Nov 24, 2003 at 21:15 UTC ( #309692=perlmeditation: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    try { 
        // Do Stuff
    ...
    catch (Exception e) {
        // Handle any other error
    }
    
  2. or download this
    eval {
        # Do stuff
    ...
    if($@) {
        # Handle any errors
    }
    
  3. or download this
    eval {
        # Do stuff
    }; if(@$) {
        # Handle any errors
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlmeditation [id://309692]
Approved by gjb
Front-paged by broquaint
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: (13)
As of 2015-07-02 10:48 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 (34 votes), past polls