Just another Perl shrine | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
It just occured to me that I now have public, private and protected variables thrown in for free...
TEXT, SECRET and NOTSOSECRET are fully accessible by package Base. Other packages (has-a's and is a's) have to use methode calls.
Classes which inherit from Base can work with TEXT and NOTSOSECRET.Classes which don't inherit can only access TEXT. This works for me I guess. The overhead of calling a method to set/get a variable I can live with, and, actually put to good use to check the setters for invalid parameters. Thanks, all, for the comments and the links! In reply to Re^2: OO - best way to have protected methods
by gargle
|
|