The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


Win32::StrictFileNames - Enable case sensitive filenames checking.


  use Win32::StrictFileNames;


In Windows, the directories and files names are case-insensitive. That can be bothersome, for example, if one develops a cgi script that must also turn under an *nix machine: it is necessary to verify the case of all the filenames and paths carefully. There is also the typos in the modules names: for instance, if you type in a script use tk; instead of use Tk; you obtain a bunch of error messages unrelated with the typo.

With this module, if the name of a file doesn't match (in a case-sensitive manner) the one of the system, a diagnostic message is printed (or the function that uses this filename fails).

Strict checking

It's the default behaviour of the module. For instance, with this script:

  #!/usr/bin/perl -w
  use strict;
  use Win32::StrictFileNames;
  use tk;     # <-- there is a typo here

  my $mw = MainWindow->new();

we obtain the error message:

  Can't locate in @INC ...etc

and the compilation is aborted as usual.


With the warn option, the compilation is not aborted but a detailed diagnostic message is issued.

  #!/usr/bin/perl -w
  use strict;
  use Win32::StrictFileNames 'warn';
  use tk;     # <-- there is a typo here

  my $mw = MainWindow->new();

gives the warning message:

  Warning: case sensitive mismatch between
  File =C:\perl\site\lib\
  Long =C:\perl\site\lib\
    at C:\tmp\ line 4.

File is the pathname of the file to load, Long is the longpathname (composed of longname components) and Short is the shortpathname (composed only of short (8.3) path components).




Home page:


None currently known.

Caution: this module has not been tested intensively ;-)


Jean-Louis Morel, <>


Copyright (C) 2006 by Jean-Louis Morel.

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself, either Perl version 5.8.6 or, at your option, any later version of Perl 5 you may have available.