note
tobyink
<p>Perl doesn't have true private methods. Underscores are merely a convention to indicate that a sub is intended for internal use only.</p>
<p>It is possible to create do-it-yourself private subs by checking <c>caller</c> within a sub and then calling <c>die</c> if the caller is outside your module. Though this will have a performance impact if you do it a lot, and is of questionable benefit.</p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-757127">
<small><small>
<tt>perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'
</tt></small></small>
</div></div>
1012994
1013029