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

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

by wanna_code_perl (Pilgrim)
on Jul 14, 2013 at 03:00 UTC ( #1044198=note: print w/ replies, xml ) Need Help??


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

If $foo is an object, you shouldn't be peeking at $foo->{name} anyway; write an accessor so that you can do $foo->name.

Funny you should mention that. That's precisely what I was trying to do when I first saw the "DEFAULT block did not return a suitable reference to the hash dereference at ...". I decided it wasn't worth it a short time later, but it was starting to look like I'd have to implement most of the class inside one of Contextual::Return's METHOD { ... } blocks.

You're spot on, though. If I use anything, it'll probably be Want.


Comment on Re^2: Contextual::Return blocks: can they be made to return the actual result?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2014-12-21 21:46 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (108 votes), past polls