Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Simplest way to get a comprehensive listing of package names available in CPAN?

Tags:

perl

cpan

Suppose that, as a private project, I have implemented a Perl package, and tested it, both formally and through extensive everyday use. I find the package useful and solid enough to warrant submitting it to CPAN.

Up to this point, since the package has been a private project, I have not worried too much about the package's name, but now that I want to submitted to CPAN, however, I would like the package's name to fit well within the ecology of package names already in CPAN.

In order to find a suitable "CPAN name" for my package, I would have to inspect a comprehensive listing of all these package names1.

What is the simplest way to get this comprehensive listing of names of packages in CPAN?


ObPedantry

(IOW, if the question above is already clear enough for you, you may safely ignore what follows.)

I don't think that I can give a technically correct formal definition of what I mean here by "package name", so let me at least give an "operational definition".

If, for example, the one-liner

$ perl -MFoo::Bar::Baz -c -e 1

fails with an error beginning with

Can't locate Foo/Bar/Baz.pm in @INC ...

..., but after installing some distributions from CPAN, the same oneliner succeeds with

-e syntax OK

...then I'll say that "Foo::Bar::Baz is a package name in CPAN".

(We could split hairs over the package/module distinction, and consider scenarios in which the distinction matters, but please let's not.)

Furthermore, if after inspecting the list this question asks about I discover that, on the one hand, there are in fact many eminent package names in CPAN that begin with the prefix Foo::Bar::, and on the other, there are none (or negligibly few) that begin with the prefix Fubar::, then this would be a good enough reason for me to change the name of my Fubar::Frobozz package to Foo::Bar::Frobozz before submitting it to CPAN.


1 Of course, after inspecting such a list, I may discover that my package does not add sufficiently new functionality relative to what's already available in CPAN to warrant submitting my package to CPAN after all.

like image 547
kjo Avatar asked Feb 24 '17 13:02

kjo


1 Answers

If you have run cpan before, you have downloaded a comprehensive package and distribution list under <cpan-home>/sources/modules/02packages.details.txt.gz.

A fresh copy is available on any CPAN mirror, e.g. http://www.cpan.org/modules/02packages.details.txt.gz .

like image 121
mob Avatar answered Nov 15 '22 09:11

mob