Annoying Windows typo

jplindstrom on 2005-01-10T10:04:46

This is fairly annoying. Mentioned here for future reference. The filesystem in Windows isn't case sensitive, Perl doesn't care and the error message you get is "Subroutine x redefined".

Let's say you have My::ModuleName in My/ModuleName.pm . This:

use My::ModuleName;
use My::Modulename;
loads the file twice because %INC contains the case sensitive loaded file. But on the file system this evaluates to the same file.

You could argue that Perl does what you say. Load the file with this name. Okay.

You could also argue that Perl doesn't do what you say. Load this module, once. Eeep!

Of course, the problem isn't that it is loaded twice, it's that the mistyped module name gets loaded at all.

Anyway the actually annoying thing with this is that the error message you get from this typo is
Subroutine new redefined at ../My/Modulename.pm line 58.
which doesn't really help you figure out exactly where you made the wrong turn if you don't already know that this is the cause.