On Tue Jun 06 09:52:38 2006, MTHURN wrote:
Show quoted text> Inside cpanp 0.061, @INC shows as follows:
>
> CODE(0x234c8c)
> /usr/local/lib/perl5/5.9.2/sun4-solaris/usr/local/lib/perl5/5.9.2
> /usr/local/lib/perl5/site_perl/5.9.2/sun4-solaris
> /usr/local/lib/perl5/site_perl/5.9.2
> /usr/local/lib/perl5/site_perl
> .
> /usr/local/lib/perl5/site_perl/5.9.2/
> /usr/local/lib/perl5/site_perl/5.9.2/CPANPLUS/inc
> /usr/local/lib/perl5/site_perl/5.9.2/CPANPLUS/inc/installers
>
> Notice that the entry right after . has a trailing slash. When the
> 'o' command executes, CPANPLUS::Internals::Search::_all_installed
> does its File::Find in this directory, but then when it does the
> substr($mod, length($dir)+1,-3) in line 289, it's off by one
> character and adds non-existent modules like "PANPLUS" to the list.
Good catch. Even though the code that adds the extra @INC directories will
be removed in the next release, it's a prudent course of action to protect
against this.
The following patch has been added:
==== //depot/cpanplus/devel/lib/CPANPLUS/Internals/Search.pm#30 - /Users/kane/
sources/p4/cpanplus/devel/lib/CPANPLUS/Internals/Search.pm ====
281a282,285
Show quoted text> ### make sure to clean up the directories just in case,
> ### as we're making assumptions about the length
> ### This solves rt.cpan issue #19738
> $dir = File::Spec->canonpath( $dir );
Which should fix the 'trailing /' issue you reported:
$ perl -MFile::Spec -le'print File::Spec->canonpath( shift() )' /foo/
/foo