>>>>> "SHC" == Shawn H Corey <shawnhco...@ncf.ca> writes:

  SHC> On 11-04-27 09:16 PM, heyi xiao wrote:

  >> In the source code of some bioperl modules, I saw method names
  >> start with "_". For instance, _print, in the following lines:

  >> $self->_print($buff);
  >> $self->_print("\n");

  >> But I couldn’t find the subroutine or function definition for these
  >> methods anywhere. Are these special or internal methods inherited
  >> from elsewhere? Any ideas? Thanks!

  SHC> I don't know mush about BioPerl but the convention for Perl objects is
  SHC> that all methods that start with an underscore are helper methods.

let me correct that. methods starting with _ are conventionally private
methods. in general they should never be called from outside a
module. they can be changed and removed and the external caller
shouldn't ever know that.  they don't have to have pod for them. the pod
coverage module that checks for pod for all methods will skip these
methods.

it is important to know this is a convention that many modules use but
it can be ignored or broken which is a bad idea.

uri

-- 
Uri Guttman  ------  u...@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------

--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to