Problems? Is your data what you think it is? | |
PerlMonks |
Re^3: Moose: using value of one attribute in another attributeby tobyink (Canon) |
on Jan 12, 2013 at 13:32 UTC ( [id://1013039]=note: print w/replies, xml ) | Need Help?? |
Perl doesn't have true private methods. Underscores are merely a convention to indicate that a sub is intended for internal use only. It is possible to create do-it-yourself private subs by checking caller within a sub and then calling die if the caller is outside your module. Though this will have a performance impact if you do it a lot, and is of questionable benefit.
perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
In Section
Seekers of Perl Wisdom
|
|