LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This 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


Reply
  Search this Thread
Old 04-20-2006, 11:56 AM   #1
nutthick
Member
 
Registered: Jun 2004
Distribution: Slack
Posts: 214

Rep: Reputation: 30
Perl install, two copies now?


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?

Thanks
 
Old 04-20-2006, 07:36 PM   #2
zaichik
Member
 
Registered: May 2004
Location: Iowa USA
Distribution: CentOS
Posts: 419

Rep: Reputation: 30
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:

http://www.guides.sk/muo-mar02/basics/bshell5.html

4. I've not heard of MCookie. I wasn't able to find anything on it at cpan.org, either. Do you have any links/other info on this module?
 
Old 04-21-2006, 05:20 AM   #3
nutthick
Member
 
Registered: Jun 2004
Distribution: Slack
Posts: 214

Original Poster
Rep: Reputation: 30
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.
 
Old 04-21-2006, 11:09 AM   #4
tredegar
LQ 5k Club
 
Registered: May 2003
Location: London, UK
Distribution: Fedora38
Posts: 6,147

Rep: Reputation: 435Reputation: 435Reputation: 435Reputation: 435Reputation: 435
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.

HTH
 
Old 04-21-2006, 06:13 PM   #5
zaichik
Member
 
Registered: May 2004
Location: Iowa USA
Distribution: CentOS
Posts: 419

Rep: Reputation: 30
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:

fsadmin@turin [~]# ls -la `which perl`
lrwxrwxrwx 1 root root 13 Mar 6 2005 /usr/local/bin/perl -> /usr/bin/perl*
fsadmin@turin [~]# ls -la /usr/bin/perl
-rwxr-xr-x 2 root root 942729 Apr 11 13:03 /usr/bin/perl*
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Slow file copies mwn Linux - Networking 2 12-18-2005 09:06 AM
Do Perl functions usually modify variables, or return modified copies? Why? johnMG Programming 3 02-06-2005 10:22 PM
How to burn Simultaneous copies? mcle Linux - General 8 01-04-2005 10:41 AM
Printing multiple copies wjn Linux - Networking 4 12-16-2003 07:19 PM
perl(Cwd) perl(File::Basename) perl(File::Copy) perl(strict)....What are those? Baldorg Linux - Software 1 11-09-2003 08:09 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 10:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration