in reply to Exceptions and Return Codes
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
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Exceptions and Return Codes
by agoth (Chaplain) on Jun 29, 2001 at 18:06 UTC |