Browsing a Local CPAN Mirror
Last month, I showed how to fetch a subset of the CPAN (Comprehensive Perl Archive Network) to create a local mini-mirror. The subset included just the latest distribution of each module, plus the index files, so that the CPAN.pm module could install and update your local modules.
Sunday, December 15th, 2002
Last month, I showed how to fetch a subset of the CPAN (Comprehensive Perl Archive Network) to create a local mini-mirror. The subset included just the latest distribution of each module, plus the index files, so that the CPAN.pm module could install and update your local modules.
I can use the mini-mirror to install CPAN modules when I’m disconnected from the net (like when I’m on a cruise ship for Geek Cruises, or at 30,000 feet, jetting off to another Perl training site).
But I often find myself just browsing through the recent additions to the CPAN to see what’s new, what’s cool, and what’s being updated. That’s easy to do online, because http://search.cpan.org provides a “Recent Additions” link. But offline, the data is much less readily available as the RECENT file shows only a few days of past activity. Worse, my mini-mirror doesn’t download either the RECENT file or any of the README extractions for the distributions.
So, I started wondering if there was a way I could use just my mini-CPAN and still browse the newest distributions, or even better, dump out the README files for those distributions if they existed. Surely, the information was there in the form of the mirrored timestamps on the distributions themselves. And the README files, while not extracted, were certainly present inside the tar.gz files. And that led me to create the program presented in Listing One.