razed has asked for the wisdom of the Perl Monks concerning the following question:

Greetings, most venerable monks. I have a quick question. I installed v5.12.1 via CPAN the other day, and I didn't want to. It seems that v5.10.1 is still installed as well. How can I uninstall v5.12.1 from my machine? Thank you in advance!

Replies are listed 'Best First'.
Re: v5.12.1 installed via CPAN
by marto (Cardinal) on Jun 09, 2010 at 14:31 UTC

    For clarification, which OS are you running? Can you remember what you did in cpan which caused this to happen? Did you install either Bundle::CPAN or Bundle::libnet?

    Thanks

      I'm running Ubuntu 10.04. I needed POSIX for a script. Not knowing that it comes with the default install, I opened up CPAN and typed 'install POSIX'. CPAN informed me that it couldn't do so because POSIX is only available for version v5.12.1, and suggested that I install v5.12.1. I had allowed it to auto-accept the defaults, so it went on with downloading and installing while I wasn't looking.
        Just out of curiosity, I tried 'install POSIX'. I'm using 5.8.8, so it came back at me with

        I'll build that only if you ask for something like
        force install POSIX
        or
        install J/JE/JESSE/perl-5.12.1.tar.gz

        If you didn't enter "force install", it shouldn't have installed it. You can check to see what perl your system is using with perl -v. If the install didn't delete your Policies, then the old perl should come up.
Re: v5.12.1 installed via CPAN
by proceng (Scribe) on Jun 10, 2010 at 04:33 UTC
    Unless you have disk issues, you can safely let the two co-exist (at least on Linux and Solaris - I don't have access to other platforms). You should still have an executable named perl5.10.1 in the install directory's bin subdir.

    Under the lib subdir, you will have subdirs corresponding to the version (5.10.?, 5.12.1) that will contain the modules that are appropriate to the version, so you should still be able to run.

    For instance, since my development perl is under /usr/local/perl, and I have 5.8.9, 5.10.1 and 5.12.1 installed, I have /usr/local/perl/bin/perl, which is hard linked to /usr/local/bin/perl5.12.1. I also have perl5.8.9 and perl5.10.1 in the same directory.

    Under /usr/local/perl/lib, there are 5.8.9, 5.10.1 and 5.12.1 subdirs (also under /usr/local/perl/lib/site_perl). They will all operate correctly.

    If you simply *must* remove the 5.12.1 capability, you *may* be able to use apt to downgrade your perl install.

    If disk space is not an issue (and you must use 5.10.1), execute the following:

    cd $(dirname $(which perl))
    This will change to the directory where the perl binary is located.
    Now, find the perl 5.10.1 binary and compare it to the perl binary (I am showing mine, which is 5.12.1:
    ls -i perl && ls -i perl5.10.1 && ls -i perl5.12.1 1198045 perl 1156173 perl5.10.1 1198045 perl5.12.1
    The first column is the starting inode number for each file. Note that on mine, both perl and perl5.12.1 point at the same file, while perl5.10.1 is a different file. If this is the case on your machine, you can do the following:
    sudo rm -f perl sudo ln perl5.10.1 perl
    Now, any perl module you run that starts with #!/usr/bin/perl (or wherever your perl executable is located) will use v5.10.1, while you will still have 5.12.1 available.

    Good luck.

      Thanks guys! I had assumed that having two versions of Perl installed was causing my problem. Good to know that they can co-exist. Thanks for the tip!
Re: v5.12.1 installed via CPAN
by ikegami (Patriarch) on Jun 10, 2010 at 00:10 UTC

    There shouldn't be any harm from having two versions installed. I have numerous version on both of my machines. The only issue might be disk space.

    I didn't find any mention of an uninstaller in the docs — it seems to be rare in the unix world — so you'll probably have to delete it manually.