![]() |
|
laziness, impatience, and hubris | |
PerlMonks |
comment on |
( #3333=superdoc: print w/replies, xml ) | Need Help?? |
If a failure is a "normal" thing, a special return value is fine.
If a failure is an "exceptional" thing, I'd prefer a death that I can catch. If extra information needs to be provided, I'd prefer a package-specific global, or (using recent Perl exceptions that can handle die $object), a death object which can be queried. So there's no one "right answer". It really depends on how frequent and how complex the failure can get. And as long as I'm on the soapbox, the wrong answer is "put it into $@", as some of the IO::* does. That's reserved for an eval failure, Graham. Usurping that was a bad idea. Bleh. -- Randal L. Schwartz, Perl hacker In reply to Re: Exceptions and Return Codes
by merlyn
|
|