good chemistry is complicated, and a little bit messy -LW |
|
PerlMonks |
Re: Re: chaining method calls (smart error object)by submersible_toaster (Chaplain) |
on Jun 12, 2003 at 06:56 UTC ( [id://265290]=note: print w/replies, xml ) | Need Help?? |
I like your idea, enough even to have a bash at it myself, moreso for educational purposes than anything. The first thing that struck me thought was "How can AUTOLOAD determine boolean context?". I know that wantarray will define whether the calling context is list, scalar or void. However I am stumped when it comes to determining boolean context. If I have you right.., and Some::Package returns error objects on failure. Presuming the new method fails, returning an error object (populated with some meaningful message), then the call to connect will be caught by the error object's AUTOLOAD. At this point we determine context, and depending on that confess. Is there nothing already out-there to do this? I'm off to CPAN first. ++tye I can't believe it's not psellchecked
In Section
Meditations
|
|