in reply to Contextual::Return blocks: can they be made to return the actual result?
In my opinion, the whole approach of Contextual::Return is misguided. Either return an object that has a rich API (so that you can use it as a string, for example. See overload), or let the caller tell you what kind of return value it wants.
Everything that goes beyond the simple void/scalar/list context distinction is guesswork, and guessing shouldn't be used for such fundamental things as return values.
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Contextual::Return blocks: can they be made to return the actual result?
by wanna_code_perl (Friar) on Jul 13, 2013 at 15:31 UTC |
In Section
Seekers of Perl Wisdom