http://www.perlmonks.org?node_id=1044156


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.

  • Comment on Re: Contextual::Return blocks: can they be made to return the actual result?

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

    Agreed. Unfortunately, I went from "wow, this is cool!", to "how is this bit supposed to work?", to "how is any of this supposed to work?" Too bad, it's a module I really wanted to like.