Just for completeness, one can easily achieve the effect of "private subs" by using lexical coderefs.
{ package MyClass; my $private= sub { ... }; $private->(); # call as private function }
Sorry for nitpicking :)
UPDATE:
and of course
$self->$private(); # call as private method
to pass thru $self as first argument.
Cheers Rolf
In reply to Re^2: perl module subroutine (private method)
by LanX
in thread perl module subroutine
by sudeeps
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |