On *nix (specifically any system that uses a colon as it's $PATH separator), working paths that have double colons (in my case named for the module) break @INC when testing via Test::Harness. Working in a directory '/usr/home/james/test-harness-colonpath-bug/Bro::ken', this error output is seen:
# Error: Can't locate Foo.pm in @INC (@INC contains: /usr/home/james/test-harness-colonpath-bug/Bro ken/blib/lib /usr/home/james/test-harness-colonpath-bug/Bro ken/blib/arch /usr/home/james/myperl/lib/perl5 /usr/home/james/myperl/lib/p
See how @INC is being broken in the middle of a directory name, which causes the module to not be found.
I realize that this may not be a bug per-se in Test::Harness, as it is just setting $ENV{PERL5LIB}, and Perl is then interpreting it incorrectly:
Test::Harness::Straps::_INC2PERL5LIB(/usr/local/lib/perl5/5.8.6/Test/Harness/Straps.pm:423):
423: return join $Config{path_sep}, $self->_filtered_INC;
DB<2> p $Config{path_sep}
:
DB<3> p join $Config{path_sep}, $self->_filtered_INC
/usr/home/james/test-harness-colonpath-bug/Bro::ken/blib/lib:/usr/home/james/test-harness-colonpath-bug/Bro::ken/blib/arch:/usr/home/james/myperl/lib/perl5:/usr/home/james/myperl/lib/perl5/site_perl:/usr/local/lib/perl5/5.8.6/i386-freebsd:/usr/local/lib/perl5/5.8.6:/usr/local/lib/perl5/site_perl/5.8.6/i386-freebsd:/usr/local/lib/perl5/site_perl/5.8.6:/usr/local/lib/perl5/site_perl/5.8.5/i386-freebsd:/usr/local/lib/perl5/site_perl/5.8.5:/usr/local/lib/perl5/site_perl:.
However, Test::Harness could change from using $ENV{PERL5LIB} to manipulating @INC directly, which should address this. At the very least, checking if any individual element of @INC contains $Config{path_sep} before turning @INC into $ENV{PERL5LIB} and issuing a warning if an element does would go a long way towards easing diagnosis of the problem.
The attached tarball contains a simple example of the problem. It contains two folders named Bro::ken and Work-ing. Running
perl Makefile.PL
make test
in each will expose the bug.
Message body not shown because it is not plain text.