On Fri, 11 Jan 2002, Tatsuhiko Miyagawa wrote: > use Exception::Handler > MyException => \&my_handler, > AnotherException => \&another_handler, > __DEFAULT__ => \&default_handler; > > eval { MyException->throw }; # my_handler() > eval { AnotherException->throw; }; # another_handler() > eval { YetAnotherException->throw; }; # another_handler() : hierarchical > eval { FooBarException->throw; }; # default_handler()
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. -- <!-- Matt --> <:->Get a smart net</:->