Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

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

by moritz (Cardinal)
on Jul 13, 2013 at 13:54 UTC ( #1044156=note: print w/ replies, xml ) Need Help??


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 (Pilgrim) 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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1044156]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (3)
As of 2015-08-30 00:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (346 votes), past polls