in reply to Re: Re: multiple db connects
in thread multiple db connects
You also said:
Well, no; the die just *dies*. Your sub won't return at all. Your program will die, unless you have an eval block, in which case the die will shoot you out to the closest eval block, and will populate $@ with the error message. And then you said:> The die clause still returns > a false value for the sub call, right?
Certainly. That's why the errors should be handled. :)> But this could cause > errors if not handled in the main clause, right?
Instead of dying, then, you could have your sub return a false value. That would work. Then you could do your checking out in the caller. Some people find that preferable, I'm sure, and that's fine; my preference is to throw exceptions as soon as something bad happens. Then I catch them.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Re: Re: multiple db connects
by ichimunki (Priest) on Dec 21, 2000 at 21:45 UTC | |
by merlyn (Sage) on Dec 21, 2000 at 21:55 UTC |