Why would the filename put in %INC be the "proper" name? I would think it would use whatever the user typed, unless it somehow gets canonized during the search process?

Yup, it shows the name in the program, not the actual file name:

[D:\download\public\Perl]perl -MData::Dumper -e "use cArP; print Dumpe +r (\%%INC)" VAR1 = { 'Exporter.pm' => 'D:/Program Files/Perl-5.6/lib/Exporter.pm', 'Carp.pm' => 'D:/Program Files/Perl-5.6/lib/Carp.pm', 'XSLoader.pm' => 'D:/Program Files/Perl-5.6/lib/XSLoader.pm', 'warnings/register.pm' => 'D:/Program Files/Perl-5.6/lib/warn +ings/register.pm', 'warnings.pm' => 'D:/Program Files/Perl-5.6/lib/warnings.pm', 'overload.pm' => 'D:/Program Files/Perl-5.6/lib/overload.pm', 'Data/Dumper.pm' => 'D:/Program Files/Perl-5.6/lib/Data/Dumpe +r.pm', 'cArP.pm' => 'D:/Program Files/Perl-5.6/lib/cArP.pm' };
Perhaps the right place would be in the code that searches @INC for the module? If it finds something that differs only in case, and it's a case-insentive OS, issue a warning and take the file name that was actually found, so things import properly.

I don't know why, but Data::Dumper for example just doesn't work if called DaTA::Dumper, even though there is no error of any kind.

—John


In reply to Re: Re: use Module and case-insensitive file names by John M. Dlugosz
in thread use Module and case-insensitive file names by John M. Dlugosz

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.