in reply to Private Class Methods
There are several ways to do "private" methods.
That's known as a gatekeeper. I haven't seen that a lot. That kind of private allows inheritance to work. The other way, requiring that you must be of that class and that class alone would be to do something like ref $self eq __PACKAGE__, more akin to C++'s private.sub _my_private_method { my $self = shift; die "Private method, jerk!" unless UNIVERSAL::isa($self, __PACKAGE__); # ... Continue on here as normal }
------
We are the carpenters and bricklayers of the Information Age.
Don't go borrowing trouble. For programmers, this means Worry only about what you need to implement.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Private Class Methods
by perrin (Chancellor) on Apr 05, 2002 at 21:43 UTC | |
|
Re: Re: Private Class Methods
by RMGir (Prior) on Apr 06, 2002 at 14:27 UTC |