> So, I can use $p::var as some arbitrary global variable even under "use strict" and even when "p" is not referring to any package at all?

Well, first, $p::var isn't a global variable; it's a package variable. And p:: does refer to a package; it specifically refers to the package p. So I would reformat your question as follows:

So, I can use $p::var as some arbitrary package variable even under "use strict" and even when "p" doesn't refer to a package that I've specifically declared (i.e., with the "package" keyword)?

And the answer is, yes. I suppose you could consider that a deficiency of "use strict".

> Is it an advisable thing to do?

Well, personally I would say not. It's bound to confuse someone somewhere. And technically it's allowing you to autovivify a variable, which is what you're trying to avoid by use'ing strict. So I'd avoid it.


In reply to Re: Re: Re: what's $p'a=$a mean? by Oberon
in thread what's $p'a=$a mean? by chunlou

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.