I'd think you'd want to know that whoever is calling the _protected_method() ->can( "_protected_method" )
That's correct, and actually -- it works. The level for caller took some playing with, but caller(1) turns out to be right: caller(0) would be the _protected_sub itself, while caller(1) is whomever called the _protected_sub.
I'd name this method _PROTECTED()
Good point, noted.
In particular, consider a case where I've "exported" a sub into my method namespace.
Hm, interesting. I hadn't considered what would happen when exporting methods like that, since I've never had need to do things like that. I will have to bring it up with my design team and see what to do about it. That particular case seems to work (though I don't entirely understand why), but I can see where more complicated cases in the same class might cause problems.
Thank you, and ++;
In reply to Re^5: Private and Protected class methods (caller)
by radiantmatrix
in thread Private and Protected class methods
by radiantmatrix
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |