Sun Dublan
April 21, 2004 Archives 

April 21, 2004

Installing a new version of Perl 01:33 PM, 0 Comments

When one installs a new version of Perl, all of the modules that were installed using the old version stay with the old version, and so you're stuck with a raw install of Perl without your beloved modules. This is because each module is binary compatible with that version of perl it was installed for. Manually going through and trying to install each module is a pain, to say the least.

This is where CPAN's autobundle comes in handy. Before compiling and installing your new version of Perl, use autobundle to make a CPAN bundle of your currently installed packages. Run the CPAN shell and run:

cpan> autobundle

It'll then make a bundle and tell you where it is. If you're using BSD, you'll have to get out of the CPAN shell to install the new version of Perl via ports. You can have concurrent installs of Perl. If this is on BSD, you they provide a "use.perl" command which allows you to switch the system's perl distro. You don't want to do that quite yet, as you can run the new Perl binary (i.e. /usr/local/bin/perl) without touching the currently installed Perl (i.e. /usr/bin/perl). So, you want to run CPAN as the new Perl and install your recently created Bundle, using Bundle::bundle_name (nuking the .pm at the end) and away it will go:

cpan> install Bundle::<bundle name>

Follow it through its progress, as it may ask you for something because of a module with an interactive Makefile.PL. After it's done, you can run use.perl to switch to the new binary.

11/2/2004 Webmaster: Troy Bowman