One of the weirdest portability problems I’ve ever encountered is dealing with platforms with case-insensitive filesystems. Files I expected to be there mysteriously weren’t. Files I didn’t expect to be there mysteriously were.
Case-sensitivity in programming languages confuses novices too, especially on insensitive platforms. The capitalization of certain words matters within the language where it doesn’t on the filesystem.
Usually that only leads to mysterious error messages. Though a novice may not know enough about the language to decipher the message yet, there’s no silent failure. Unfortunately, there’s a case in Perl where there are silent failures: pragmata.
A pragma is a module which has almost no interface. It exists merely to enable or to disable certain behavior. Think of strict or warnings.
When you use a module (use strict;), Perl takes the bareword name and translates that into a file path, using @INC as a list of directories to search for that file. If Perl loads and compiles that module, it attempts to call the import() method defined in the module so named. (There’s a special trick inside Perl to avoid any weird failures if that method does not exist.)
There is absolutely no requirement that code declared inside a module has to correspond to the name of the file; there’s no mapping between file names and namespaces in Perl. Here’s the problem with case-insensitive file systems and Perl pragmata.
On a system with a case-insensitive filesystem, you can say use Strict; and Perl will happily load strict.pm for you. That part’s fine. The second part isn’t–Perl will call Strict->import();, which probably does not exist. strict.pm defines strict::import() instead, which is what you want, but Perl won’t call that.
Because the strict pragma only warns when active, you may assume that your code is strict-safe, when in reality there are no warnings because you didn’t enable warnings.
There are various possibilities to fix this, but it’s a thorny problem. See The Strict Trap on the Perl 5 Porters mailing list for more information.


Plain and simple, the interpreter should be checking the package name when it imports the Module. In the meantime a variant of Abigail's solution should be put into the strict.pm and any other module. Only the message should be very abusive and make the idiot who typed "use Strict" cry. :) There are legitimate mistakes and there are retarded mistakes, programmers should always assume case sensitivity, so this mistake is retarded.
@Vance, there are legitimate reasons to have the package name not match the file name... at least in any way that static analysis can detect.
I agree that assuming case insensitivity is a mistake, but I'm not sure how a novice programmer can intuit that case matters without guidance (and abusive error messages aren't the way to go).
I have to agree with chromatic in that the abusive error messages would cause more grief than be of help. This is another case for having each and every Perl book start off with he same note: always "use strict" and "use warnings" (or the -w switch).
A number of us are Unix geeks, but there are unfortunately an increasing number of novice coders out there who are and have always been on a case-insensitive system, such as Windows. I remember when I first started in Unix (some 10 years ago) and it took me a little bit to get used to the case sensitivity, but having to deal with it on a daily basis made it come quicker to me.
All in all, using warnings is probably the best solution, but with an error message that makes sense, even for a novice. We want to encourage people to code in Perl, not discourage them. :-)
If we are talking about *just* solving the "use Strict" vs "use strict" then I agree mostly with Vance. If you try to solve it beyond that case (no pun intended) then you have to think a little harder about the whole thing.
I was of course being a little silly to illustrate a point. Hand holding novices doesn't do anybody any good. It creates the expectation in them that they can screw up and the language will figure out what they meant. While the language can figure it out, it comes at a cost. Namely more bugs, and more clock ticks.
Does anyone really have a problem with this? When I learned Perl, the book and all of its examples had "use strict;", so why would anyone even think of capitalizing it in the first place.
More importantly though, it is probably a bad idea to have any identifiers (data, subroutines, module names) that vary only in case. Even an experience programmer for whom case-sensitivity is natural can forget the right case and type an identifier wrong. And it is confusing and hard to "speak out."
This probably all belongs in some 'lint' like pre-processor.