G'day Josh / p5p / p6l, >> given ($@) { >> # [snip] >> 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. The documentation clearly needs to make clear what that default means, because it's certainly not exception suicide. The exceptions thrown from autodie bind smart-match (used in given/when) to a 'does/has_role' style check. The ':all' test (which may change its name) checks against a meta-role shared by all autodie exceptions. If something doesn't match that, then it wasn't an exception from autodie. It could have been an exception from something else, or even a plain string exception. > 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. Yes, I've seen this sort of behaviour too, and I'm being particularly mindful to make sure it doesn't happen with the code in autodie. I've marked myself down a TODO item to make sure there's a big barrage of tests to ensure that $@ still contains what we expect at the end of each exception handling block. Cheerio, Paul -- Paul Fenwick <pjf@perltraining.com.au> | http://perltraining.com.au/ Director of Training | Ph: +61 3 9354 6001 Perl Training Australia | Fax: +61 3 9354 2681Thread Previous | Thread Next