True, use strict "refs"; doesn't catch the use of symbolic references via string literals (that is, strings that are compile-time constants). __PACKAGE__ expands to be a string literal.

use strict "refs"; adds run-time checks to make sure that you don't dereference a variable that you expected to contain a real reference but that actually contained something else. Since there is no way for __PACKAGE__ to be a real reference, it sort of makes sense for use strict "refs"; to not disallow dereferencing it. Or you could consider this a bug in strict's implementation.

So I guess I should update what I said from "You don't avoid using symbolic references by avoiding certain types of dereferencing syntax." to this:

You don't avoid using symbolic references by avoiding certain types of dereferencing syntax, but you will need to avoid using certain types "hard-coded" references.

I had forgotten about this quirk of strict.

        - tye (but my friends call me "Tye")

In reply to (tye)Re2: self-referent hash for your packages by tye
in thread self-referent hash for your packages 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.