use Strict; is a rather complex no-op. It does nothing of consequence (other than confuse people reading your code into thinking it might do something).

use strict; gives you lots of errors because that is what it is supposed to do. See strict.pm for a little discussion about why you might want to have all of these errors generated. The basic idea is that use strict makes it more likely that you'll find a mistake early and thus save you a lot of time. But using it requires a few basic changes to the way you write scripts (you have to declare your variables so it can tell when you mispel a variable name, for example).

As already mentioned, the reason "use Strict;" does nothing silently is partly because Win32 file systems ignored the case of letters in file names. Well, that is part of the reason. The other part of the reason is that Perl (stupidly, IMO) doesn't complain when you include a module via one name but that module doesn't actually go by the name you gave.

You can run into the same problem quite a few other ways. For example, you might try to install Bogon::Quartz for your web page where you don't have "shell" access so you put the Quartz.pm file on the server and figure out that use Quartz; doesn't complain about anything and then you can't figure out why this module doesn't work like the documentation says it should. Perl should really tell you that use Quartz; did not find any module called "Quartz" even though it found a Quartz.pm file. There are even more ways to run into this problem if you are working on writing a module yourself.

So, in the end, it would be really nice if UNIVERSAL::import() complained when you used a module that didn't match the namespace you requested. You might find Universally unimportant and overused useful (and important).

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

In reply to (tye)Re: use strict (upper or lower case) by tye
in thread use strict (upper or lower case) by Anonymous Monk

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.