Proper Exception Handling

Ovid on 2006-10-05T22:35:23

After being at my first meeting of the Nottingham Linux User's Group, I started thinking about proper exception handling. Why isn't there an exception class on the CPAN which, when encountering an exception, determines if it's being run in debug mode and if so, throws you into an interactive mode which allows you to examine and alter the call stack and resume execution? It seems bloody obvious and trivial to write (think PadWalker), but no one's bothered that I know of (you Smalltalk programmers can stop laughing now, thank you).

Perhaps later when I sober up ...


For perl5db.pl

jjore on 2006-10-05T23:47:18

Ok, do this.

$DB::single = 1;

assertions

salva on 2006-10-06T08:22:52

That's more or less what assertions (available from perl-5.9) do. Under the debugger they behave as conditional breakpoints.

More info is available from the module documentation and from this p5p thread.