in reply to Do you use an exception class in your Perl programs? Why or why not?
1. No I don't. I tried to use them, but failed to see how they can make my life easier, and code cleaner and more reliable, comparing to using die. When I'm using eval I usually just want to know if code succeed or failed, I can't remember right now any case where I wanted to perform different actions based on the $@ content. Some of my colleagues are actively using Exception::Class and, from my point of view, it doesn't make their code better. I just hate to see statements like:
do_something or MyCompany::Product::Subsystem::Module::Exceptions::IOE +rror->throw("Couldn't open $file: $!");
2. If I will learn how to use exception objects to improve my code quality I will immediately start to use them.
4. Yes, I think generally it is a bad idea. Redefining $SIG{__DIE__} may cause some hard to debug problems.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Do you use an exception class in your Perl programs? Why or why not?
by TGI (Parson) on Mar 14, 2010 at 01:39 UTC | |
by zwon (Abbot) on Mar 14, 2010 at 10:14 UTC |