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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |