I prefer the Smalltalk usage because it is extremely descriptive of what is happening.

In Smalltalk, classes are objects. As objects they have methods. Those methods are the class methods.

Instances of the class are objects. As objects they have methods. Those methods are instance methods.

Since the class and the instance are different objects, and moreover different kinds of objects, it comes as no surprise that they have different methods.

None of this is applicable in Perl, of course, since Perl packages are not objects. (Simon Cozens wanted to make that possible, but last I heard it got vetoed as potentially breaking too much old code.) But in languages where classes are themselves objects, the Smalltalk terminology is how you should think about things. And people who come from languages like that (for instance merlyn) tend in Perl to like distinguishing between methods that are meant to be called through the name of the class (eg new) and those that are called from an instance (everything else).

Which is why I, along with merlyn, dislike the construct you sometimes see of:

my $pkg = ref($self) || $self;
Its purpose is to blur the distinction between methods of the class and methods of instances of the class, and we see no reason that that distinction is a bad thing to have.

In reply to Re (tilly) 2: How to call Class method inside an object? by tilly
in thread How to call Class method inside an object? by chorg

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.