locked_user sundialsvc4 has asked for the wisdom of the Perl Monks concerning the following question:

In many languages I have used, it was possible to “throw an exception of a particular class,” such as EOverflowError, and, in an exception handler, to respond based not only upon the message but the class.   Does such a facility exist in Perl?   (Silly question...)   Which one would you recommend?

Any particular suggestions on how you use such a facility in an HTTP-oriented program ... especially one that is still stuck in the Dark Ages of redirects?

Replies are listed 'Best First'.
Re: Exception classes in Perl?
by wind (Priest) on Jun 15, 2011 at 01:05 UTC

      “Ouch, kiss, hug, and bleep.”   There’s a story in that.   Or maybe a country song.

Re: Exception classes in Perl?
by planetscape (Chancellor) on Jun 15, 2011 at 05:46 UTC
Re: Exception classes in Perl?
by 7stud (Deacon) on Jun 15, 2011 at 02:26 UTC

    You might want to read the following for an evolutionary overview:

    link

    Error.pm provides a lot of syntactic sugar that tends to break easily. As such, its use is not too recommended. On the other side, there's the Exception-Class module which provides object-oriented exceptions with no special syntactic sugar, and which works very well. Its use is highly recommended.