in reply to REALLY Private Methods in perl: Is Perl Flexible enough to be made Inflexible?
Yes. There are quite a few variations of "privateness" documented in theDamian's excellent Object Oriented Perl. You can check the file and line number of caller, for example.
However, the moment you do that, I would not want to maintain your code. Every attempt I've seen at privacy has made the code more unmaintainable.
Just name your "private" methods with a leading underscore, and put "do not call outside of this class" in a comment. People will get the idea, and they deserve what they get when they violate it. Why is that so hard to understand?
-- Randal L. Schwartz, Perl hacker
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: •Re: REALLY Private Methods in perl: Is Perl Flexible enough to be made Inflexible?
by penguin (Sexton) on Sep 23, 2002 at 14:34 UTC | |
by merlyn (Sage) on Sep 23, 2002 at 15:28 UTC | |
by sauoq (Abbot) on Sep 23, 2002 at 20:03 UTC | |
by Anonymous Monk on Sep 23, 2002 at 23:28 UTC | |
by penguin (Sexton) on Sep 23, 2002 at 23:31 UTC | |
by Anonymous Monk on Sep 23, 2002 at 22:59 UTC |
In Section
Seekers of Perl Wisdom