in reply to Windows pitfall: Subroutine redefined with use Modul
you'll see something like:use Data::Dumper; print Dumper(\%INC);
so, the file is one but Perl sees (and loads) two modules. this could also pose serious problems with imported symbols, because when the case of the package name doesn't match, Perl loads the .pm file but doesn't export anything, as in:$VAR1 = { [...] 'subclass1.pm' => 'subclass1.pm', [...] 'Subclass1.pm' => 'Subclass1.pm', [...] };
this is even more unobvious, because the error goes unnoticed until you try to use something that's exported from the module.use fIlE::SpEc qw(catfile); # note the wrong case $x = File::Spec->catfile('a', 'b', 'c'); # this works $x = catfile('a', 'b', 'c'); # this croaks
unfortunately, Perl can't possibly catch this sort of errors, so you have to watch your case. one possible solution (for the typo-prone individuals :-) could be to always cut & paste the use line from the SYNOPSIS found in the module documentation.
King of Laziness, Wizard of Impatience, Lord of Hubris
|
---|