A few days I decided to upgrade ActivePerl on my laptop. Not the major upgrade to 5.10.0, not yet, I just wanted to have the new GUI version of PPM, just like I already had on my other computer. It's just a minor upgrade between builds of perl 5.8.8, from build 817 to build 822. That should be relatively painless... Not so.
Well, despite the fact that XS modules are binary compatible, the new build refuses to install on top of the older build. That means I'll have to uninstall perl, install the new version, and reinstall every module I had added. Ouch.
I remember having taken a Bundle snapshot with CPAN.pm over a year ago, and it wasn't pretty: installing that bundle resulted in CPAN.pm wanting to reinstall core modules. I didn't want to live through that again, besides, this being Windows, installing through CPAN would probably not be trivial for some modules. So this time, I was going to try to use PPM, and, preferably, automate it.
It's easy to get a list of modules installed with PPM, complete with version numbers into a file, with ppm query *
or (is this new?) ppm list
. (Oh, fun, apparently the output format has changed.).
But after that, I'm stuck. How the hell do you use that list to install those packages automatically? I'm stumped. I want to:
Simple enough. But it looks like having PPM just do that by feeding it that list, simply isn't in the list of supported features.
So I ended up installing most of these modules by hand, list in hand. Well, I tried. It turned out some of the modules were still not properly installed. For example, Crypt::SSLeay was missing its DLL, and Win32::API just didn't work.
So now, days later, I'm still stuck with an incomplete set of reinstalled, and possibly broken, modules. I now just have to install additional modules when I find some script is broken. Oh, joy.
And then, there are still some modules (WWW::Mechanize and HTML::TokeParser::Simple) of which the API had changed, so, with freshly installed (and upgraded) modules, my scripts just didn't work any more. I've had to figure out what changed, and modify the script. Not fun.
I'm not looking forward to upgrading to 5.10.
p.s. I have some vague plans, if necessary, to write a shell script, controlling ppm through the command line, to install or upgrade the whole list.
Re:Win32::API pain
bart on 2008-01-30T09:09:17
I don't know exactly what failed, all I know is I had to reinstall Win32::API. I used PPM both times.
I did have an additional problem when installing CAM::PDF, also with PPM. My virus scanner (Grisoft's AVG) didn't like the double extension of one of the scripts, ".pdf.bat", it block access to that file and it even when I clicked "it's OK to run this file", which interrupted installation of that module. Time and time again. Plus, it apparently broke off installation of the rest of the modules in the to do list.
I suspect that Win32::API was in this list, so that, even though I assumed it was installed, it actually wasn't.
So, it's not your fault. I didn't try to install it with CPAN, not this time (though I have MinGW), because I was not planning on spending more time on this than I had to. Heck, I already spent way too much time on this.
And no, I'm sticking with XP. I'm planning to avoid Vista forever, I'm holding out for its successor, hoping it will be better, in a few years time — if Microsoft gets its act together. (The Windows OS needs to be put on a diet.)
perldoc -t perllocal \
| perl -lne 'print $1 if/"Module" (\S+)/'
| xargs -n 1 cpan
Re:Short shell script
bart on 2008-01-30T09:12:36
Good idea, except for one detail: the module list is not the list from this installation of perl, but of the previous one, that has already been deleted. So it needs to be a multi-step process:
- save the module list to a file
- reinstall perl
- run the rest of your oneliner using that file as its input