Currently I have Perl 5.8.8. Can I update to Perl 6? I am using Red Hat Linux 5 OS. Is it possible to upgrade Perl on Red Hat Linux 5 or any other OS? If yes, how can I do that?
2 Answers
I'll try to articulate an answer that addresses all your requests, HTH:
I wouldn't touch system Perl, because other system software might depend on a particular version. If you need a different version of Perl 5 for development, it's arguably better to install it in a controlled, isolated environment
To do so you can use tools like Perlbrew: with Perlbrew you can install distinct versions of Perl 5, and you'll be able to switch back and forth according to your development needs
You say you want to "update to Perl 6". Perhaps you noticed I wrote Perl 5 in the previous paragraphs. Perl 6 is not just a new version of Perl, but a profound evolution of the language: it stems from the same core principles, but it is quite different from its older sibling. Code written in Perl 5 won't run in Perl 6, for example
To sum up:
- You can have both Perl 5 and Perl 6 on your system, but they are distinct languages
- You can have multiple versions of Perl 5 using Perlbrew
- I would suggest not to tamper with the version of Perl distributed with the OS

- 1,431
- 2
- 14
- 26
-
Thanks larsen , the reson I am looking for a differenct version of Perl is that I want to work with Excel file in Perl (create , read and write ) but my system Perl that is v5.8.8 does not seem to have any module for that , Would you be able to tell since which module Perl5 included utility for Excel files? – Vicky Jul 24 '17 at 15:25
-
As far as I know, Perl 5 distribution never included among the core modules a library parse/write Excel files. There are plenty on CPAN, tho': my personal favourite for writing Excel files (should I say I'm lucky that I seldom have to parse them?) is [Excel::Writer::XLSX](https://metacpan.org/pod/Excel::Writer::XLSX) – larsen Jul 24 '17 at 15:32
-
1@Vicky There are [224 matches of 'excel'](https://metacpan.org/search?size=500&q=excel) among the 30,000+ free packages (170,000+ modules) on CPAN. One or more of these should do what you want to do. Use cpantesters to see whether a particular module that looks good "on paper" is likely to actually work out for you in practice. For example, I see 6 passes out of 6 for [Excel::Writer::XLSX tests on 5.8.8 in today's cpantester results](http://www.cpantesters.org/distro/E/Excel-Writer-XLSX.html). – raiph Jul 24 '17 at 19:10
-
@Vivky It's a good idea to tell people what you want to accomplish rather than how you are trying to do it. :) – brian d foy Jul 24 '17 at 21:17
Perl 5 and Perl 6 are really different languages that share a name. Installing Perl 6 will not overwrite your Perl 5. I'm guessing that you don't want Perl 6 and instead want the latest version of Perl 5 (v5.26 was just released). You might consider updating everything to something recently released, including your OS ;)
If you're curious what your package manager is going to install, you can see the list. Perhaps How to list the contents of a package using YUM? is interesting for you.
Aside from the system's installed Perl 5, you can download, compile, and install other versions of Perl5 to any location you like. I have all the perls installed, for example, and the system perl is still there.

- 129,424
- 31
- 207
- 592