What this does is uses the special token __PACKAGE__ to invoke a static (class) method called compile() with the arguments you see there. Specifically, an array reference with four elements.

The __PACKAGE__ token yields the current package that the interpreter is executing in (this wording is kind of cramped, I realize, but I can't think of a better way to say it right now). If the interpreter encounters it in an inherited method from within a subclass, it will yield that subclasses name. What this means is, a method in an intended base-class can write this as a way of invoking compile as a method, without using an actual object reference. It's still treated as a method invocation, and uses the @ISA search path of the actual (sub)class, not the original class from which it was derived.

--rjray


In reply to Re: __PACKAGE__-compile .. what in the world is this? by rjray
in thread __PACKAGE__-compile .. what in the world is this? by princepawn

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.