Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Managing modules of various versions

by flexvault (Parson)
on Feb 20, 2013 at 11:39 UTC ( #1019770=note: print w/ replies, xml ) Need Help??


in reply to Managing modules of various versions

Hello TomDLux,

You don't say what operating systems you are using, but if it's a *nix version, you should be able to use 'ln -s'.

I support a number of *nix ( AIX, Debian, Suse, etc ) boxes and I leave the default Perl to the operating system. But I install different versions of Perl in the '/usr/local/bin/' directory. I use a separate filesystem (or directory) for all Perl version source code and 'configure' and 'make' etc so that I have completely different directories for each Perl version.

I then go to the '/usr/local/bin/' directory and move the newly installed 'perl' to 'perl5.14.2' or whatever the actual version is. Now if it's a new and untested Perl, I use link 'ln -s -f perl5.14.2 perltest'. You need the force if it is already defined. When the testing is complete and your happy with the Perl version, you use link 'ln -s -f perl5.14.2 perlgood' and now your "official" version on that box is 'perlgood'. ( Note: I don't use 'perlgood', but link the base 'perl' to the tested 'good' version) (Also, any CPAN dependencies have to be installed in the new Perl.)

You can verify which release by:

perltest -v
And you can see all versions you have by:
ls -l /usr/local/bin/perl*
and you get something like this:(just the end column)
... /usr/local/bin/perl -> perl5.12.2 ... /usr/local/bin/perl5.10.1.threads ... /usr/local/bin/perl5.10.1 ... /usr/local/bin/perl5.12.2 ... /usr/local/bin/perl5.16.0 ... ... /usr/local/bin/perltest -> perl5.16.0
Okay, so how does this help you?

Now you have a way to check-point scripts that have a dependency that a newer version of Perl doesn't work/support/etc. For instance you notice that I have a threaded and non-threaded versions of perl5.10.1. If you have a script dependency on threads, you can hard-code the shebang to:

#!/usr/local/bin/perl5.10.1.threads -w
Unless I have a need for 'threads' in *nix, I run all scripts with a non-threaded Perl for perfomance. YMMV!

AIX and CPAN are almost mutually exclusive. So I usually have to download and manually install. So scripts on AIX tend to not get updated as much as the Linux systems. I hope you get the idea, and if you improve the process I'd be interested in any and all improvements. ( And don't forget to document the process for your fellow workers. )

Good Luck...Ed

"Well done is better than well said." - Benjamin Franklin


Comment on Re: Managing modules of various versions
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1019770]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (8)
As of 2014-09-17 08:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (67 votes), past polls