in reply to Re: Can we continue after an exception?
in thread Can we continue after an exception?

Hm, unfortunately that module is not sexy enough for my taste :-) Thanks for the warning though. Any recommendations on other Exception modules for use in Perl5? I cannot seem to get a sense of major consensus or even widespread usage at all in this area.
  • Comment on Re^2: Can we continue after an exception?

Replies are listed 'Best First'.
Re^3: Can we continue after an exception?
by clinton (Priest) on May 31, 2007 at 15:08 UTC
    I played around with the various exception modules, and eventually settled on what Perl already provides:
    eval { step1(); step2(); }; if (my $error = $@) { # rethrow error if we can't handle it die $error unless ref $error && $error->isa('My:Error'); handle_error($error); }

    clint

Re^3: Can we continue after an exception?
by perrin (Chancellor) on May 31, 2007 at 14:23 UTC
    The only one that is widely used is Exception::Class. Seriously, you are taking your life in your hands if you use Error's try/catch syntax. It caused multiple hard-to-find bugs in a large system I worked on.