tags:

views:

77

answers:

1

After installation of latest Bundle::CPAN, I realized that certain legacy code will not run in this latest version. I wish to remove (and not just unlink) this latest version and revert back to using the old version. How can I do that?

+2  A: 

Perl nor CPAN.pm have a way to go back to what you had before you installed later versions of modules. See How can I de-install a Perl module installed via cpan?.

Next time, however, you can fix this problem.

Here's what I recommend:

  • If you can figure out which modules are causing the problem, install those in separate directories and adjust @INC to use those directories. Do that until you figure out the module versions you need.

  • When you figure out the distributions you need, grab those from CPAN or BackPAN. Keep the distributions locally and set up your own MiniCPAN with just those distros. Since CPAN has as a design feature to track only the latest versions of any distribution, you want to make your local MiniCPAN pretend that the older distributions are the latest versions. That's why I created MyCPAN::App::DPAN. I write a bit about this in Manage multiple MiniCPANs, and version them

  • Once you get things fixed, put your Perl libraries into source control so you can always roll back an installation. See Manage your Perl modules with git.

  • Come up with an installation and testing policy where you don't disturb anything before you know that everything works. Part of that is testing new installations outside of your main Perl library directories. When you think you're satisfied, then you can install into those directories.

brian d foy