Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: Trapping Error Object

by gellyfish (Monsignor)
on Feb 04, 2002 at 22:07 UTC ( #143304=note: print w/ replies, xml ) Need Help??


in reply to Trapping Error Object

I think that what you want is eval BLOCK but all this is a little vague.

You would do something like:

eval { # do something that might raise a fatal error }; if ( $@ ) { # do something to report the error # $@ contains the error message or error object }

However it might be useful if you gave us a bit more of a clue as to what it was you were trying to do.

/J\


Comment on Re: Trapping Error Object
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (5)
As of 2015-07-04 01:02 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 (57 votes), past polls