CPAN is the single biggest strength of Perl. Without the (literally) 10,000 man-years of work available for free, Perl would be nothing more than a semi-interesting footnote in the early history of the web. Other than some neat text-processing facilities, Perl doesn't have much going for it in terms of being a good business workhorse language. Other than the CPAN.
But, CPAN's greatest strengths (a million solutions for every problem, anyone can just upload stuff) are also its greatest weaknesses. How do you find a CPAN module that does what you need, let alone the right CPAN module?
- Use CPAN's search feature (http://search.cpan.org). You may have to use a number of different synonyms to find modules.
- Don't restrict yourself to the first page of results. I always click the 100 on the right-hand side to see 100/page vs. the default 10.
- You will have to look at several modules to find a few good candidates. I generally read between 4-7 to get a sense of what's going on.
- Take a very close look at the version number and the last-uploaded date for the distributions. You're looking for the following:
- A last-updated date within the past year. Anything older than that is probably not being actively maintained anymore. While this isn't a death knell, it is a strike against this module.
- If it's 0.01, 0.02, or 0.03, it's probably not what you want. Remember, CPAN is often the place where active authors will collaborate. Kind of like a global SVN. :-)
- If you have any questions, don't hesitate to email the author using the address on the author's CPAN page. If that bounces, don't use the module unless you're willing to maintain it.
- Install your top 2-3 choices and play with them. At this point, you're going for functionality, not speed. If a couple tests fail, force the installation. Just because the author screwed up a testcase with your platform doesn't mean it won't work for you. You probably won't use that feature anyways. Even if you do, it's usually just a minor edit of the source.
Don't forget to ask your friends, IRC channels, or here for advice. But, most importantly, email the author if you have questions about the fitness or suitability of a given distribution for a given task. We want to hear from you. We're certainly not getting paid for this work. Knowing our code is in active use is one of the very few rewards for being a CPAN author.
My criteria for good software:
- Does it work?
- Can someone else come in, make a change, and be reasonably certain no bugs were introduced?