Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Trapping Error Object

by Anonymous Monk
on Feb 04, 2002 at 20:13 UTC ( #143290=perlquestion: print w/ replies, xml ) Need Help??
Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hello:

I have written some code that sends MS Alerts. It works well, but I cannot figure out how to trap errors. I want to be able to trap errors in a manner similar to the asp error object or at least retrieve the same info.

TAC

Comment on Trapping Error Object
Re: Trapping Error Object
by gellyfish (Monsignor) on Feb 04, 2002 at 22:07 UTC

    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\

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (9)
As of 2015-03-29 20:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When putting a smiley right before a closing parenthesis, do you:









    Results (632 votes), past polls