in reply to Hiding methods of class
Perl commonly marks private methods with a leading underscore. Example:
sub new {} # construct a new object sub mymethod {} # public method for an object sub _mymethod2 {} # private method for an object
There is no technical way to prohibit someone from using a private method. You can write lots of code to try to restrict access but they can undo whatever you have written!
So I recommend you just use a leading underscore and don't describe _mymethod2() as a public interface in your POD( you are writing documentation, right? ;) ).
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Hiding methods of class
by Joost (Canon) on Jan 16, 2008 at 22:16 UTC | |
by Herkum (Parson) on Jan 17, 2008 at 04:37 UTC | |
|
Re^2: Hiding methods of class
by parv (Parson) on Jan 16, 2008 at 22:53 UTC |