- Redhat Enterprise Linux 5.5.56 64-bit (I realize we should upgrade but we won't be doing that, this is a dept decision.)
- Old version of perl 5.8.8 is installed
at the system level in its own 5.8.8 directory somewhere in the system (i.e. not in my home dir, it's in /usr/lib/perl5/5.8.8/), and I think the cpan modules are also because when I install a module I use 'sudo cpanm Mod::Name'.
- I just upgraded from perl 5.8.8 to perl 5.20.1 using: curl -L http://xrl.us/installperlnix | bash
- This appears to install perlbrew and put the new perl in $HOME/perl5/perlbrew/perls/perl-5.20.1/bin/perl
- I have an executable file which is /usr/bin/perl.
- The system perl was installed years ago by me, so me and 4 others are the only people who use this box, and we use only perl scripts that I made. So it shouldn't be an issue to change the link to point to the new perl.
Questions:
How do I change the file at /usr/bin/perl to a link which executes $HOME/perl5/perlbrew/perls/perl-5.20.1/bin/perl? I.e. /usr/bin/perl should actually execute $HOME/perl5/perlbrew/perls/perl-5.20.1/bin/perl. This would be the easiest way for our other 4 users to automatically use the new Perl without me having to edit their PATH variable in their .cshrc.
- Do I need to change the owner or permissions of everything in $HOME/perl5/ so everyone can use the link?
- Will this new version of perl still use the system cpan modules?
- When I install new cpan modules using 'sudo cpanm Module::Name' will they still be installed to the system location with all the other modules?
- Can I keep my PERL5LIB set to this: 'setenv PERL5LIB /usr/lib/perl5/site_perl/5.8.8/auto:/usr/lib/perl5/site_perl/5.8.8'?
Thank you! You're all awesome!
EDIT1: Uh oh, it turns out I'm trying to use the 'ln $HOME/perl5/perlbrew/perls/perl-5.20.1/bin/perl /usr/bin/perl' and getting a "Invalid cross-device link" because my $HOME and /usr/bin are on different devices. Any advice to fix this?
Should I just make a shell script /usr/bin/perl which contains:
#!/bin/csh
/export/home/chuck/perl5/perlbrew/perls/perl-5.20.1/bin/perl \!*
"\!*" is what I would type into the text editor to add all parameters to the perl command line when the shell script is called. Is that the right syntax for csh? Owner of /usr/bin/perl would have to be root with permissions a+rwx.
EDIT2: Question closed. Thanks I got this partially working, I am having some problems setting @INC, because I installed some CPAN modules and they are now in the new perl subdir. I'll make another question for that later.