Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^5: Moose: using value of one attribute in another attribute

by tobyink (Abbot)
on Jan 13, 2013 at 07:10 UTC ( #1013092=note: print w/replies, xml ) Need Help??


in reply to Re^4: Moose: using value of one attribute in another attribute
in thread Moose: using value of one attribute in another attribute

True; that slipped my mind (even though I use the technique occasionally). These things are mostly circumventable (Scope::Upper for caller, PadWalker for lexical coderefs, etc), but perhaps the lexical subs coming in Perl 5.18 will be different.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
  • Comment on Re^5: Moose: using value of one attribute in another attribute

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1013092]
help
Chatterbox?
[marto]: only at work 3 days this week, then off to Copenhagen for a wedding
[marto]: back the following Monday, potentially gone 2-3 days the next week for work
[Corion]: Oh - "Cyber Monday" week is coming up... That's why weird stuff is already discounted now...
[Corion]: marto: Oh, cool, I hope you get to enjoy the trip and Copenhagen! I found it nice (but the mermaid is underwhelming)
[marto]: the kids and their mother are coming too, actually only 9 people at the wedding in total. Still, will be fun

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2017-11-19 11:41 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    In order to be able to say "I know Perl", you must have:













    Results (280 votes). Check out past polls.

    Notices?