Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
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 drinking their drinks and smoking their pipes about the Monastery: (8)
As of 2014-07-13 15:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (250 votes), past polls