Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Managing modules of various versions

by flexvault (Prior)
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 imbibing at the Monastery: (5)
As of 2015-07-04 11:29 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (59 votes), past polls