in reply to Can we continue after an exception?

In addition to what GrandFather said, I recommend you avoid the try/catch syntax in this module and look at Exception-Class-TryCatch instead. The block approach that Error uses can cause a lot of subtle bugs.
  • Comment on Re: Can we continue after an exception?

Replies are listed 'Best First'.
Re^2: Can we continue after an exception?
by dgaramond2 (Monk) on May 31, 2007 at 08:05 UTC
    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.
      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

      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.