Keeping up with the Joneses
Restoring the Features of Yore
Back in the day, there were two choices for installing code from the CPAN: the original CPAN client and CPANPLUS. Innovation in one kept driving the other, and by the release of perl-5.10, both had sprouted all kinds of features and usability enhancements. They'd also gotten easier to use, but maybe not easy enough. When Miyagawa released App::cpanminus (aka
cpanm), there was much rejoicing, and it's become incredibly popular in its two short years of life.
One of the reasons that
cpanm has remained so easy to use is that it jettisons huge numbers of the advanced features of
CPANPLUS. Some of these are only needed for pretty exotic configurations like automated testers or enterprise environments. A few, though, were pretty useful for everybody. My favorite were probably the
upgrade commands in the CPAN shell.
r (which as far as I know has no longer name) prints out a report on installed modules that aren't the latest version. For example, if I run it right now, I see this:
upgrade command finds the same list, but instead of just printing it out, it installs all the new code.
These have several good uses. The first one is obvious: you can keep your whole installed development environment up to date with the latest releases. This is maybe a little crazy for your production environment, but if you're installing to a local::lib, it's a great way to test your code against a full upgrade. It's also great for debugging. When I get a bug report that I can't reproduce, I often ask the reporting user to show me the output of a report like this. I compare it to mine, and half the time I see a relevant different: the user has an older Moose, I have an older Params::Validate, or something along those lines.
This kind of feature is great, but it's totally outside the realm of stuff that
cpanm is ever going to do. That doesn't mean we need to go back to the old clients just yet, because Tokuhiro Matsuno wrote App::cpanoutdated. It does the work of CPAN's
This is a less information than the
r command. It doesn't tell us what the relevant module is, or what version we have installed, but it turns out that this is generally enough. It still tells you which dists are out of date, which is just about as good as which modules. (You also might note that it's a different set of dists. That's because I had to run these commands on different installs, because I haven't kept my own
cpan working very well since I switched to
cpanm! That's all.)
It has another great property, too: you can pipe the output of