Matt Sergeant writes: > I don't like this for the same reason I don't like $SIG{__DIE__} - it > promotes action at a distance. In a 1000 line .pm file I *want* to have my > exception catching mechanism next to my eval{} block.
You need this flexibility, but Perl allows you to do more, for good reasons. One of the things I don't like about traditional try/catch handling is that it doesn't allow for class level programming. You need to allow any subroutine to try/catch exceptions (die). It's also nice to notify any object in the stack that there is an unhandled exception passing through its code. This eliminates a lot of explicit try/catches. This allows reuse without clutter. If you're familiar with Aspects, it's basically the same concept. Rob