http://qs321.pair.com?node_id=302959

Brutha has asked for the wisdom of the Perl Monks concerning the following question:

Hello fellows,

this is not a question, but a warning about an issue, which cost me a day. This is a Windows specific problem. Is that hint enough to solve the following?

After boiling down the needle-in-haystack problem and dropping all but the necessary lines, I have the following three files:

File Baseclass.pm

package Baseclass; use strict; use subclass1; print "load Baseclass\n"; sub new { my $class = shift; return bless {},$class; } 1;
File Subclass1.pm

package Subclass1; use strict; use warnings; use base( "Baseclass" ); sub new { my $class = shift; return $self = $class->SUPER::new(@_); } print "load Subclass1\n"; 1;
File Bla.pl

use strict; use warnings; use Subclass1; my $obj = Subclass1->new; 1;
Now run perl bla.pl and you get the following output:
Load Subclass1 load Baseclass Subroutine new redefined at Subclass1.pm line 11. Load Subclass1
Now, here comes the solution.

It is simple but not really obvious in the sense of visible. It is the letter 's' or should I say 'S'?
In file Baseclass.pm line 3 uses 'subclass1' instead of 'Subclass1' with capital letter. Perl sees two modules use Subclass1; and use subclass1;. Windows does not care about case and gives Perl the file Subclass1.pm both times.

Hope this helps somebody, save your day for better things.

And it came to pass that in time the Great God Om spake unto Brutha, the Chosen One: "Psst!"
(Terry Pratchett, Small Gods)