Perhaps you could have raised a RT ticket for this issue.
Perhaps then either myself or Jos would have been able to investigate the issue. It is only because I happened to being checking perlmonks today that I spotted this.
You hit the nail on the head, it is the distributions that have package names that are slightly unusual that parse_module has a problem with. In the vast majority of cases it can make an educated guess and get it right.
CPANPLUS' module tree is exactly that, a tree of modules, which includes the name of the package that that module is contained in. Creating a mapping back the other way as well, ie. PACKAGE -> MODULE, is going to add more memory usage for the indexes.
That said, there may be a way. I'm digging further.
But please, do raise that ticket, so I don't forget.
Updated:
Found a possible solution which I will endeavour to roll into the next release. In the meantime this should work for those pesky edge-cases:
use strict; use warnings; use CPANPLUS::Backend; my $cb = CPANPLUS::Backend->new(); my $string = shift || die; my $mod; unless ( $mod = $cb->parse_module( module => $string ) ) { ($mod) = grep { $_->package_name eq $string } $cb->search( type => 'package', allow => [ qr/^\Q$str +ing\E/ ], ); } print $mod->name, ' ', $mod->package, "\n" if $mod;
In reply to Re: CPANPLUS won't install distros by name (e.g. Scalar-List-Utils)
by bingos
in thread CPANPLUS won't install distros by name (e.g. Scalar-List-Utils)
by wu-lee
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |