develooper Front page | perl.perl5.porters | Postings from May 2003

[perl #22077] Module Loading on Case-Insensitive File Systems

Thread Next
David Wheeler
May 1, 2003 06:00
[perl #22077] Module Loading on Case-Insensitive File Systems
Message ID:
# New Ticket Created by  David Wheeler 
# Please include the string:  [perl #22077]
# in the subject line of all future correspondence about this issue. 
# <URL: >

This is a bug report for perl from,
generated with the help of perlbug 1.34 running under perl v5.8.0.

An issue has just come up with Stas Bekman's release of Apache::Test. It turns
out that on case-insensitive file systems, such as HFS+ on Mac OS X, and
whatever Win32 runs these days, Perl can load the wrong module. For example,
Stas' new module is called "Apache::Test". Scripts that load it, such as
Makefile.PL in libapreq 1.2 (, do so like this:

use constant HAS_APACHE_TEST => eval {require Apache::Test};

The problem, however, is that those of us who have already installed mod_perl
1.x have a copy of "Apache::test" installed already. Note the different case:
"Apache::Test" vs. "Apache::test". It turns out that, because the mod_perl
installer installs Apache::test in the platform directory (e.g.,
site_perl/5.8.0/darwin/Apache/ on my system), while Apache::Test gets
installed in the usual Perl library directory (e.g., on my system,
site_perl/5.8.0/Apache/, because of the order of @INC (see below),
Apache::test actually gets loaded instead of Apache::Test! Even worse, because
Apache::test has no version number CPANPLUS seems to think that Apache::Test
is up-to-date, even though, technically, it's not installed at all!

This appears to be because although HFS+ is a case-insensitive file system, it
is also a case-preserving file system, and Perl doesn't necessarily know
that. What would be great is if, on case-insensitive but case-preserving file
systems, Perl was smart enough to check the case of any files it finds on the
file system before actually loading them. FWIW, the `find` utility that comes
with Mac OS X seems to be able to tell the difference:

  mercury# find . -name ""
  mercury# find . -name ""

Note that when I told `find` to search for "" it didn't find any
"" files, and when I told it to search for "" it didn't find any
"" files. So it pays attention to the case you tell it to look for when
it searches the file system. Theoretically, Perl can do this, too, at least on
case-insensitive file systems that are also case-preserving. Or so I would

Stas and I are discussing other strategies for overcoming this problem. But if
there was some way to tell Perl to do a case-sensitive require, that would be
preferable. There isn't some kind of pragma or something to correct this
behavior, is there?



Site configuration information for perl v5.8.0:

Configured by david at Sat Dec 21 18:17:50 PST 2002.

Summary of my perl5 (revision 5.0 version 8 subversion 0) configuration:
    osname=darwin, osvers=6.3, archname=darwin
    uname='darwin mercury.local. 6.3 darwin kernel version 6.3: sat dec 14 03:11:25 pst 2002; root:xnuxnu-344.23.obj~4release_ppc power macintosh powerpc '
    config_args='-des -Uinstallusrbinperl -Dprefix=/usr/local'
    hint=recommended, useposix=true, d_sigaction=define
    usethreads=undef use5005threads=undef useithreads=undef usemultiplicity=undef
    useperlio=define d_sfio=undef uselargefiles=define usesocks=undef
    use64bitint=undef use64bitall=undef uselongdouble=undef
    usemymalloc=n, bincompat5005=undef
    cc='cc', ccflags ='-pipe -fno-common -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include',
    cppflags='-no-cpp-precomp -pipe -fno-common -no-cpp-precomp -fno-strict-aliasing -I/usr/local/include'
    ccversion='', gccversion='3.1 20020420 (prerelease)', gccosandvers=''
    intsize=4, longsize=4, ptrsize=4, doublesize=8, byteorder=4321
    d_longlong=define, longlongsize=8, d_longdbl=define, longdblsize=8
    ivtype='long', ivsize=4, nvtype='double', nvsize=8, Off_t='off_t', lseeksize=8
    alignbytes=8, prototype=define
  Linker and Libraries:
    ld='cc', ldflags =' -flat_namespace -L/usr/local/lib'
    libpth=/usr/local/lib /usr/lib
    libs=-lm -lc
    perllibs=-lm -lc
    libc=/usr/lib/libc.dylib, so=dylib, useshrplib=true, libperl=libperl.dylib
  Dynamic Linking:
    dlsrc=dl_dyld.xs, dlext=bundle, d_dlsymun=undef, ccdlflags=' '
    cccdlflags=' ', lddlflags=' -flat_namespace -bundle -undefined suppress -L/usr/local/lib'

Locally applied patches:

@INC for perl v5.8.0:

Environment for perl v5.8.0:
    LANGUAGE (unset)
    LD_LIBRARY_PATH (unset)
    LOGDIR (unset)
    PERL_BADLANG (unset)

Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About