I'll see what I can do. The pseudocode is:
include file
warn if file ne filename_in_INC_hash;
I'll see if I can put something in the source that works. It looks like I need to modify pp_ctl.c:pp_require().
_____________________________________________________
Jeff japhy Pinyan:
Perl,
regex,
and perl
hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??; | [reply] [d/l] |
[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 | [reply] [d/l] |
Ok. I've changed my strategy:
if (
running_under_windows
and
Foo.pm loaded
and
package_Foo doesn't exist
) { warn about case of Foo }
The reason that
use Strict;
$x = 10;
is valid is because use is merely:
BEGIN {
require Strict;
Strict->import;
}
And on Windows, require Strict goes through fine, thanks to the caseless OS. And import silently fails (as is documented).
The DaTA::Dumper thing didn't give an error because you didn't turn on warnings. If warnings were on, you'd have seen:
Name "main::Dumper" used only once: possible typo at -e line 1.
Filehandle main::Dumper never opened at -e line 1.
_____________________________________________________
Jeff japhy Pinyan:
Perl,
regex,
and perl
hacker.
s++=END;++y(;-P)}y js++=;shajsj<++y(p-q)}?print:??; | [reply] [d/l] [select] |
| [reply] |