in reply to lock a method or functinoality to class & subclass
You can do it with
die("private method!") unless (caller())[0]->isa(__PACKAGE__);
at the beginning of your private method, but that will add some solid overhead to your code, and I'm sure others will point out how it will break.
Just because you can, doesn't mean you should. I recommend you follow merlyn's advice.
pg
|
|---|