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.
  • Error.pm had exactly the same bug. The *real* solution is to overload boolean context:

    {
      package Exception::Class;
      use overload 'bool' => sub { 1 };
    }

    But you probably didn't want to know that right now ;-)

    But interestingly I don't see why people can't just use Error.pm's class structure without the try/catch semantics. At least until I get around to writing Error::Filter so that there'll be no more closures.
    • But you probably didn't want to know that right now ;-)

      No! Thats great. I think I'll leave my as_string overload because its useful for debugging purposes, but it was such an ugly kludge I was doubting my senses for returning to perl.

      re: Error::Filter, yeah I remember reading about that in your journal months ago, so where is it? Do you think we'll see it before Perl6 comes out and makes all this silly jiggering around obsolete? :)

      Btw. is the a reason to use Error.pm over Exception::Class?

      • by Matts (1087) on 2002.01.29 17:18 (#3824) Journal
        re: Error::Filter, yeah I remember reading about that in your journal months ago, so where is it? Do you think we'll see it before Perl6 comes out and makes all this silly jiggering around obsolete? :)

        Well I lost what I had in a hard disk crash. I guess if there's enough interest I'll try and put something together for my exceptions talk at TPC (assuming it gets accepted). But don't expect anything too soon - as soon as I know what talks get accepted I'll be in major head-down mode writing talks...

        Btw. is the a reason to use Error.pm over Exception::Class?

        It's shorter to type? ;-)