Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've just installed perl 5.8.8, thinking that it would overwrite my 5.8.7. Unfortunately it's stuck itself in another directory, so I now have two copies. As far as scripts go, that no big deal, just a bit of editing to point to the new one, but I have a couple of questions:
1. Is it OK to keep two copies on the machine, as I don't know which one is being used/updated?
2. How can I remove the old copy, just delete it?
3. I placed a $PATH entry to the 'old' perl directory, but I now need it to point to the new one. I can't find anything about how to remove an entry from $PATH. Any idea how to do that?
4. Lastly, this whole thing was brought about as I needed some modules installed as I needed the MCookie module. But I still don't have it. How can I get it?
1. It's normally fine to keep two versions. Frequently, this is done intentionally so that users can have the new version against which to test their scripts.
2. It depends how it was installed. If you installed it with a package manager, it would be best to remove it using the package manager. If you installed from source, it would probably be best to have an idea of the paths involved. Run perl -V for each binary and check that you are not going to be ripping out shared library directories in the course of deleting stuff.
3. That depends on your shell. A Google search on the shell and "how to change the PATH variable" will certainly lead you to the answer. For example, that search for bash netted this:
Thanks for the reply zaichik. I haven't had a chance to try the PATH method you linked to, but it looks good. The MCookie module turned out to be CGI::Cookie.
If I type which perl, I get the reply:
/usr/bin/perl ls -al /usr/bin/perl tells me that this is actually a link to /usr/bin/perl5.8.0
So, although perl is called as perl it actually invokes /usr/bin/perl5.8.0
So, rather than trying to mess with your PATH, it is easiest to delete the link to the old perl, and make a new one to the version of perl you want to invoke. Your installer may already have done this for you, but it would be sensible to check.
This method has the advantage that if your newer version of perl doesn't work, you can easily link back to the old one.
That is likely easier, and probably more effective than just adding a path. But don't just assume that /usr/bin/perl is only a symlink and delete it without checking, because that is not the case on all systems:
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.