Developer

A dirge for CPAN


On my way out the door tonight, I stopped to briefly speak with a coworker. I noticed that he was perusing CPAN. For those who are not familiar with it, CPAN is the Comprehensive Perl Archive Network, the collection of Perl libraries. As far as I know, no one has even bothered to make something similar to it for Perl try to compete with it in the Perl world. [Edited 9/18/2007 {Justin James} for clarity]

I was surprised my worker was on CPAN for two reasons. First of all, this person really does not like Perl. Second of all, his project is in VB.Net. So why in the world would he be looking at CPAN?

Because if you need to write it, there is a darn good chance someone already wrote it in Perl and put it on CPAN. Apparently, this coworker uses CPAN the way most coders use Google -- as a source for example code.

CPAN is a positively amazing resource for the following reasons:

  • CPAN code tends to be of high quality (although it's quite often of dubious usefulness).
  • CPAN is beyond comprehensive. As of 9/17/2007: 12,168 modules encompassing a whopping 3,898 MB of code.
  • CPAN is a universal resource; everyone who has written enough Perl to put it on a server somewhere will put it on CPAN because everyone else puts their code on CPAN.
  • CPAN is simple to use. Not only is the Web site so low tech you cannot get lost on it, but the Perl package itself comes with simple tools to access CPAN.
  • CPAN bundles are easy to use and access, regardless of whether you download them, view them on the screen and save the text, or use the Perl CPAN tools.
  • CPAN code is self-documenting in the Perl POD format. Say what you will about POD (it has some warts), but it is a good format for libraries since it is built into the library and source code at the same time.
  • Perl is an interpreted language so, by their nature, any libraries and modules are open source, editable, and viewable.
  • The licensing terms are quite gentle; while each module in CPAN has its own license agreement, I cannot recall ever seeing one that did not seem to say, "do what you want, I don't care."

That is enough plumping of CPAN for Perl code for the time being. I must admit -- it has been some time since I visited CPAN. Then again, it has been some time since I wrote Perl that was complicated enough to need to go beyond the built-in modules.

The whole experience with my coworker made me ask myself: Why is Perl completely unique as a once mainstream (and still not obscure) language in having something like a CPAN? Sun never gathered mass with Java as a locus for community content for a huge number of reasons. PHP could have/should have been able to reach CPAN status with PECL and PEAR, but it is nowhere close to CPAN in any respect. Microsoft has made a few attempts with GotDotNet (which is currently being dismembered) and more recently CodePlex.

What did CPAN accomplish that no one else did?

I have no answer to that question. I know that of all of the systems out there, CPAN feels the least professional. The site is probably running on 10-year-old CGI code. The site itself has not been updated in more than five years with the exception of the contents. As far as I can tell, there is no corporate sponsorship of any kind. It does not support "workspaces" or "projects" in any way. There is not a drop of advertising on it other than a tiny logo and a link to the company doing the hosting. In a nutshell, it is like an FTP site with a rudimentary search engine on top of it. At the end of the day, CPAN is something that simply "just happened" without any conscious thought or decision. The more that big sponsors try to replicate CPAN or (even worse) to foster "community," the more they seem to fail.

CPAN is probably one of the top five reasons I miss working in Perl on a regular basis; the lack of an equivalent is one reason why I will never quite adjust to the .Net ecosystem or take a shine to it the way I did Perl. I could spend hours going through CPAN, finding obscure pieces of code (Klingon language parsers, anyone?), reading through them, and learning a lot. Most of the open source stuff out there comprises an entire project, and it is both too large to make much sense from and too broad in scope to learn specific ideas from. For instance, you might need to go through thousands of lines of code that deal with the interface and validation just to find the 100 lines of interesting logic in any given project.

I know... at this point I am Ted, and Perl is Mary; it's years later, and I am still hung up on her. But, in this case, I think there is something really special about the past that no artificial attempts to recreate will ever bring back.

J.Ja

About

Justin James is the Lead Architect for Conigent.

17 comments
Sasha Chorny
Sasha Chorny

Another good point about CPAN - cpantesters. CPAN distributions contain tests and these test are executed on install and by cpantesters that tests it on many different platforms. There is JSAN - similar attempt for JavaScript by Perl programmers.

dave_cross
dave_cross

Oh, and by the way, why call this a "dirge"? That's not a very flattering word. Did you mean "eulogy"?

dave_cross
dave_cross

"CPAN is the ???Comprehensive Perl Archive Network,??? the collection of Perl libraries. As far as I know, no one ever even bothered to make something similar to it for Perl" I think that statement contradicts itself. Probably a typo. "Because Perl is an interpreted language" Nope. Perl is compiled. Ok, so it's compiled each time you run the program, but it's compiled, not interpreted. There are important differences. "Do you know of any equivalents for non-Perl languages?" The idea for CPAN was shamelessly stolen from the TeX archive CTAN (http://www.ctan.org/). Perl people have tried a number of times to take the CPAN idea to other languages that they use. The most successful one is probably the Javascript repository JSAN (http://openjsan.org/). Dave...

Justin James
Justin James

If you used CPAN, what did it have that other resources lack? Do you know of any equivalents for non-Perl languages? J.Ja

Editor's Picks