On Sun, Jun 1, 2008 at 7:31 PM, Paul Fenwick <[EMAIL PROTECTED]> wrote:
> Currently, when testing exceptions from autodie, we can use:
>
>        given ($@) {
>                when (undef)   { say "No errors here" }
>                when ('open')  { say "Open died" }
>                when (':file') { say "Some sort of file error" }
>                when (':io')   { say "Some other error" }
>                when (':CORE') { say "Some other CORE error" }
>                when (':USER') { say "A non-CORE error" }
>                when (':all')  { say "Any autodie exception at all." }
>                default        { say "Not an autodie exception." }
>        }

If you're going to write that into some documentation, I wish you'd
make default say that it's exception suicide.

    given( my $_ = $@ ) {
        ...
        default { say '$@ committed suicide' }
    }

Semi-recently at work I found that a few buggy exception objects in
the global $@ were clearing themselves out of $@ as a side effect of
examining them for truth. It's quite annoying and mysterious when it
happens.

Josh

Reply via email to