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.
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
}