|Syntactic Confectionery Delight|
OOP private functionsby zeltus (Sexton)
|on Feb 13, 2014 at 09:50 UTC||Need Help??|
zeltus has asked for the
wisdom of the Perl Monks concerning the following question:
When writing a traditional OOP package, do private functions need to be part of the object?
By that, I mean, accessors tend to look like
(it's that there "my $self = shift;" bit I am looking at with a jaundiced eye)
If an accessor wants to use a private function (say, _topsecretsort() ), are there any pros and cons or conventions in just making it an "ordinary" function, or should it be a method, as per the accessor methods>
I can't seem to find anything on this... everyone seems to do one or the other. Is there a perceived general rule of thumb for said private functions?