Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Hmm, I have a hard time agreeing with you on this one, or at least your implementation.

    'scuse the cut and paste:

    local $SIG{__DIE__} = sub {
      my $err = shift;
      if ($err->isa('MyException')) {
        die $err; # re-throw
      }
      else {
        # Otherwise construct a MyException with $err as a string
        die MyException::Default->new($err);
      }
    };

    This (which is basically what AxKit does) drives me nuts. Remember a couple of weeks ago when I

    • Well this whole thing is a real bitch, and cross platform exception objects is completely unsolved in Perl. I mean really everything should derive from a single Exception type, but nobody had the forethought to do that. I think this is a real problem with the perl community - almost too much desire to allow TMTOWTDI.

      Alternatively you could change the above to use blessed() from Scalar::Util, but that means my exception handler can't know what types to expect, and that's bad too. So my "solution" isn't brok
      • I mean really everything should derive from a single Exception type, but nobody had the forethought to do that.

        Okay, well maybe we should do something about it then. As I understand it all we need to do is decide on a common 'marker' class name that all exception class implementations - no matter how complex or how simple - use and can declare themselves to be.

        Something like

          package My::CustomException;
          @ISA = qw( ExceptionInterface );

        For each of the class. Is this right? Could