Yes THIS could be better. it says:
How does Perl know which package the subroutine is in? By 
looking at the left side of the arrow, which must be either
a package name or a reference to an object, i.e. something 
that has been blessed to a package. Either way, that's the 
package where Perl starts looking. If that package has no 
subroutine with that name, Perl starts looking for it in 
any base classes of that package, and so on.
...

The right side of the arrow typically is the method name, 
but a simple scalar variable containing either the method 
name or a subroutine reference can also be used.

If there was any paragraph saying something like

$obj->$coderef(@paras) is equivalent to $coderef->($obj,@paras) "no matter if the RHS and the LHS have any package relation"!
would be a much clearer definiton and avoiding the need to experiment. (well I'm not sure how to express the "no matter" part in clear English, but I hope the point is clear)

Cheers Rolf

UPDATED: Typo in code.


In reply to Re^6: OOP: ->Coderef for calling Private Methods (possibilites?) by LanX
in thread OOP: Obj->Coderef for calling Private Methods by LanX

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.