conventions for friend methods in Perl

Posted by xenoterracide on Programmers See other posts from Programmers or by xenoterracide
Published on 2012-09-12T20:21:11Z Indexed on 2012/09/12 21:49 UTC
Read the original article Hit count: 385

Filed under:
|
|

Perl doesn't support a friend relationship between objects, nor does it support private or protected methods. What is usually done for private methods is to prefix the name with an underscore. I occasionally have methods that I think of as friend methods. Meaning that I expect them to be used by a specific object, or an object with a specific responsibility, but I'm not sure if I should make that method public (meaning foo ) or private ( _foo ) or if there's a better convention? is there a convention for friend methods?

© Programmers or respective owner

Related posts about coding-style

Related posts about perl