Re: Perlbrew issues. Suggest a way out.
by flexvault (Monsignor) on Nov 18, 2012 at 15:25 UTC
|
perl514,
It is very easy to install multiple copies of Perl on *nix boxes. I usually have 3 to 5 versions depending on how old the computer is. Download from CPAN the version you want. I do the following system commands after verifying the checksum:
gzip -d perl-5.14.2.tar.gz
tar -xf perl-5.14.2.tar # This creates a new directory
+ perl-5.14.2
cd perl-5.14.2
./Configure -des -Dprefix=/usr/opt/perl_5_14_2 # directory should b
+e unique and already exist
make
make test
make install # This will install to /usr/op
+t/perl_5_14_2
ln -s /usr/opt/perl_5_14_2/bin/perl /usr/local/bin/myperl
This should generate a new and totally different Perl from the system Perl.
To test that everything works, just type
myperl -V # you can call it anything, but I recommend having perl
+ in the name
Some things to keep in mind.
- If you need CPAN modules, they have to be installed with 'myperl'. The libraries are totally separate from the system libraries.
- Do not change the default Perl. I usually do a symbolic link to the system perl in '/usr/local/bin/perl -> system perl. This will give an error message if I try to re-link the default perl.
- If you want the additional features for your custom Perl, read about all the options in 'Configure'. Also the Configure options are shown in all versions of perl by doing 'perl -V;grep "config_args"' which will show you how the system Perl was built.
- Hint: If you need or use other Perl commands, then I usually do a symbolic link to them. But remember, if you have multiple Perls, you will have to re-link the commands to get the correct version.
- Hint2: If you have multiple cores, do the 'make' first, and then do the 'make test' as I showed here, otherwise you may test something before it's compiled.
- Hint3: From the problems you're having, maybe re-install the operating system before doing these steps. Or try this first and if you still have problems, then re-install the system. All of my laptops have *nix and windows both with out a problem. It's easier than trying to have multiple newer *nixes on 1 box :-)
You'll never again be limited by the Perl that ships with the *nix!
I did this from memory, so if you find something that works differently, I'll check it, and update the documentation or at least mark it as system dependent.
Good Luck!
"Well done is better than well said." - Benjamin Franklin
| [reply] [d/l] [select] |
Re: Perlbrew issues. Suggest a way out.
by zentara (Archbishop) on Nov 18, 2012 at 15:59 UTC
|
And last but not the least, is there some preferred flavour of linux that any one of you could suggest? Slackware As to your problem of running multiple Perls, all you need to do is install your multiple Perl versions manually, and simply change the symlink /usr/bin/perl to point to whichever version you wish to run, like /usr/bin/perl5.14.1 or /usr/bin/perl5.16.0, etc. You just need to keep track of which Perl version you are running,
when you install modules. Thats all Perlbrew essentially does for you. If you don't have root priviledges, you can use local::lib to install to your home directory. In that case, you can put a symlink in your homedir's ~/bin directory, which will point to your privately installed Perl's, something like /home/myuser/lib/perl5/various_versions/bin/perl .... that filepath is just off the top of my head, :-)
but you should be get the idea. Do it manually, instead of relying on perlbrew.
| [reply] |
|
... is there some preferred flavour of linux that any one of you could suggest?
Slackware
I second that. Slackware is one of the few Linux distributions that still use the shell (bash or ash) for all scripting. You can completely remove Perl and Slackware will still run (but remember that the Linux 3.x kernel needs perl 5 to compile - duh!), and you can replace the system Perl with any Perl you like.
Alexander
--
Today I will gladly share my knowledge and experience, for there are no sweeter words than "I told you so". ;-)
| [reply] |
Re: Perlbrew issues. Suggest a way out.
by frozenwithjoy (Priest) on Nov 18, 2012 at 18:47 UTC
|
I kept getting dependency issues and ultimately the installation of perlbrew just failed.
I've installed Perlbrew on multiple OS X and Linux varieties with minimal issues. What "dependency issues" and errors are you having when the install fails?
After installing perl brew if I "switch" to the new perl version, while downloading modules, will it automatically install it for new perl version?What if I dont "switch" and "use" a specific Perl Version? While installing CPAN Modules, will that be automatically taken care of?
Perlbrew is pretty straightforward. Modules get installed to whichever version of Perl is currently in use.
| [reply] |
Re: Perlbrew issues. Suggest a way out.
by Anonymous Monk on Nov 18, 2012 at 13:13 UTC
|
WOW :) I suggest you ditch perlbrew, it does nothing for you, and docs / testing don't answer your question
I suggest perlall - build, test and do with all perls
| [reply] |
Re: Perlbrew issues. Suggest a way out.
by perl514 (Pilgrim) on Nov 19, 2012 at 12:09 UTC
|
Respected Monks,
Thank you very much for your replies...epsecially Flexvault and Zentara....Flexvault, your response was quite detailed and amazing. Zentara.....I am planning to go with CentOS or SL as thats much nearer to RHEL Servers which the business client uses. I sometimes wonder if perlmonks should be renamed as perltutlive :) Its your genuine helping nature that makes this community what it is.
For the others who want to know why I want some other version of Perl, I am going to write some scripts that will pull out data by opening an ssh session with some storage devices, capture the output in an array or variable and do stuff accordingly. I wonder if any other language would put up with a guy like me who is not very well versed with programming, yet trying to work on things...well, Perl surely does :) The management servers are all Windows and one of them has Perl Version 5.14.2 (DWIM Perl). So I need to have the same version of perl to try out stuff. Those systems do not have any internet connection, so I have to make do with whatever packages are installed in it.
I am going to find a way to install modules by manually copying files into the management server if the requirement comes up.
Perlpetually Indebted To PerlMonks
| [reply] [d/l] |
Re: Perlbrew issues. Suggest a way out.
by jms53 (Monk) on Nov 18, 2012 at 14:51 UTC
|
Why can't you use Perl 5.10?
If you end up installing the latest Perl from source, you can then force your interpreter to use a specific version by using use version_number.
If the version of Perl you are using is compatible with the modules (no reason why it shouldn't if the Perl version is newer) then there should be no problems.
| [reply] [d/l] |
|
| [reply] |
|
True, but the OP did say he was learning Perl. Hence my suggestion to use the system Perl.
I forgot my favorite linux flavor: CrunchBang with lxpanel instead of tint2 (although that may change if I get to configure tint correctly).
| [reply] |
|
Sorry jms53, that's got nothing to do with installing perlbrew, or perlbrew failing to install, or perlbrew not working on cenos
| [reply] |
Re: Perlbrew issues. Suggest a way out.
by linuxkid (Sexton) on Nov 19, 2012 at 15:39 UTC
|
Fedora is the best answer, I use it day-today, and have a few issues, but they are my fault. On my server though, I use CentOS, and haven't had any issues other than those I've caused.
--linuxkid
imrunningoutofideas.co.cc
| [reply] |