See Private method variations for some more ideas.
Of the two you offered I would prefer the lexically scoped coderef because you can still use the $o->$add( 42 ) calling style and not worry about subclasses accidentally breaking your code.
In reply to Re: OO - best way to have protected methods
by adrianh
in thread OO - best way to have protected methods
by gargle
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |