Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

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

by zwon (Abbot)
on Jan 13, 2013 at 06:32 UTC ( #1013090=note: print w/replies, xml ) Need Help??


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

A simpler alternative to caller would be:

my $private = sub { ... };

Replies are listed 'Best First'.
Re^5: Moose: using value of one attribute in another attribute
by tobyink (Abbot) on Jan 13, 2013 at 07:10 UTC

    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'

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1013090]
help
Chatterbox?
LanX where is the camera?
Tux => $HOME
[Eily]: you wrote boos instead of boss, and jedikaiti read that as boobs :)
[LanX]: Win claims only 8 MB left on C: how do I find out where the problem happens?
[Eily]: by Tux. And going home sounds like a good idea
[Eily]: LanX pretty much everywhere except in 8MB ?
[Eily]: s/by/bye/ someone hacked my keyboard I'm sure
[LanX]: good point! :)
[Eily]: LanX I don't understand the question though, you want to know what is taking so much space?
[Tanktalus]: Probably the swapfile :)

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (13)
As of 2017-09-20 16:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    During the recent solar eclipse, I:









    Results (237 votes). Check out past polls.

    Notices?