Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the App-perlfind CPAN distribution.

Report information
The Basics
Id: 76367
Status: resolved
Priority: 0/
Queue: App-perlfind

People
Owner: Nobody in particular
Requestors: RWSTAUNER [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 2.03
Fixed in: (no value)



Subject: perlfind sometimes chooses wrong module when not installed
I recently tried to perlfind a module that wasn't installed and was pleased to see that it downloaded the docs to a temp file and displayed it. When trying with a different module perlfind seemed to get confused and showed me the docs for the wrong one. I cannot remember what that first example was, however it happened to me again with: perlfind Dist::Zilla::Plugin::Prereqs::DarkPAN I don't have that module installed, and perlfind seems content with showing me the docs for Dist::Zilla::Plugin::Prereqs (which I do have installed). Is this a bug about finding an installed sub-namespace? (Notice the extra '::DarkPAN'). I do not have this problem if I use 'cpandoc' directly. Taking a look at the code I'm guessing that it comes from https://github.com/hanekomu/App-perlfind/blob/master/lib/App/perlfind/Plugin/UseModule.pm#L21
On Fri Apr 06 21:01:31 2012, RWSTAUNER wrote: Show quoted text
> I recently tried to perlfind a module that wasn't installed and was > pleased to see that it downloaded the docs to a temp file and > displayed it. > > When trying with a different module perlfind seemed to get confused > and showed me the docs for the wrong one. > I cannot remember what that first example was, > however it happened to me again with: > > perlfind Dist::Zilla::Plugin::Prereqs::DarkPAN > > I don't have that module installed, > and perlfind seems content with showing me the docs for > > Dist::Zilla::Plugin::Prereqs > > (which I do have installed). > > Is this a bug about finding an installed sub-namespace? > (Notice the extra '::DarkPAN'). > > I do not have this problem if I use 'cpandoc' directly. > > Taking a look at the code I'm guessing that it comes from > https://github.com/hanekomu/App- > perlfind/blob/master/lib/App/perlfind/Plugin/UseModule.pm#L21
I don't know what it would take to do this but a possible check could be: If A::B::C is not found but we have A::B check the A::B pod for a `=head` or `=item` matching `C`. If found, use it, otherwise go back to trying `cpandoc` on A::B::C. (I suppose the next step would be to try cpandoc on A::B). I understand the different "finders" are separate but it was just an idea I had for making a better guess. A simpler alternative, perhaps would be to assume that if the last symbol starts with a capital letter assume it's a module otherwise assume it's a function... it wouldn't be right all of the time, but probably most of the time.
Fixed in 2.04 according to your latter suggestion. Thanks for reporting it.