Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
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?
[Discipulus]: Hi Corion here is holiday: the best we have Liberation Day
[Discipulus]: waiting sons to finish home assignments and we go out to some park
[Corion]: Discipulus: Oh ;) I'm looking forward to 1st of May - the next holiday here ;)

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (6)
As of 2017-04-25 11:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    I'm a fool:











    Results (449 votes). Check out past polls.