in reply to Re: OO - best way to have protected methods
in thread OO - best way to have protected methods
# protected method printMe, silly example actually sub printMe { my $self = shift; caller(0)->isa(__PACKAGE__) || confess "cannot call protected +method\n"; # do something silly for now print $self->account . " " . $self->name . " " . $self->balanc +e . "\n"; }
|
---|