Did you actually try running a test of what happens if you require strict and then try to do something that strict will block?

You will find that the declaration is utterly useless.

The reason is that all of the magic of strict is buried in what the import method of strict does to the parsing of your code at compile time. A simple require loads strict too late (ie at runtime) and does not call the import method.

See Re (tilly) 1: How does strict work? for a longer explanation of how exactly strict works.

Oh, and let this be a lesson. As one Alexander Pope said:

A little learning is a dangerous thing;
Drink deep, or taste not the Pierian spring:
There shallow draughts intoxicate the brain,
And drinking largely sobers us again.
But as Aldous Huxley observed:
If a little knowledge is dangerous, where is the man who has so much as to be out of danger?
Certainly I don't! Which is why before I told you that what you were doing was useless I ran the following test of knowledge I imagine I have:
perl -e 'require strict; print $foo = "Hello\n"'
And only armed with this verification did I write this post...

In reply to Re (tilly) 1: Silly Roommate Tricks by tilly
in thread Silly Roommate Tricks by wombat

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.