Subject: | search.cpan.org |
It would be nice to grab the write distribution when you just supply a module within that distribution but it doesn't match exactly with the distribution name. The first match on a Modules search almost always gets the corresponding distribution.
Example:
cpan2rpm HTTP::Request
-> libwww-perl
cpan2rpm Net::SSLeay
-> Net_SSLeay.pm
cpan2rpm Pod::Man
-> podlators
cpan2rpm Pod::Parser
-> PodParser
I think an algorithm someting like this may work:
http://search.cpan.org/search?query=$module&mode=module
m@<a\s+href="([^<>]+/)">@
# The first link that ends with /
# will always provide the distribution link
# instead of /dist/$module/