perl 5.10

G

greymaus

I have perl 5.8.8, instaled 5.10, had some small problems with it, so I
wemt back to 5.8.8 (ln /usr/bin/perl5.8.8 /usr/bin/perl). Now, I want to
do some work with 5.10. How do I get the system to have one user have
perl->perl5.10.0 and the rest have perl->perl5.8.8.?
Something in his/her .profile ?
 
O

Owen

I have perl 5.8.8, instaled 5.10, had some small problems with it, so I
wemt back to 5.8.8 (ln /usr/bin/perl5.8.8 /usr/bin/perl). Now, I want to
do some work with 5.10. How do I get the system to have one user have
perl->perl5.10.0 and the rest have perl->perl5.8.8.?
Something in his/her .profile ?


try something like this in the .bashrc or .profile files

export PERL5LIB="/usr/bin/perl5.10.0"


See if that works.


Owen
 
B

Ben Morrow

Quoth Owen said:
try something like this in the .bashrc or .profile files

export PERL5LIB="/usr/bin/perl5.10.0"

Err... no. Not even close.

The simplest answer is to install 5.10 without the /usr/bin/perl alias
(pass -Dversiononly -Uusrbinperl to Configure) and then set up a shell
alias perl => perl5.10.0 for that user. The alternative would be to
install 5.10 somewhere else entirely (like /usr/local, or /opt/perl5.10)
and put that location first in that user's path.

Both of these require that you install perl yourself from source. If
you're installing it from a package system you will need to see if that
package system supports this sort of thing.

Ben
 
P

Peter J. Holzer

try something like this in the .bashrc or .profile files

export PERL5LIB="/usr/bin/perl5.10.0"

PERL5LIB tells the interpreter where to look for modules. It doesn't
tell the OS where the interpreter is.

On Unix systems (and I assume greymaus is using something unixish
because of the unix-like pathnames and the mentioning of .profile) you
usually use the shebang line to tell the OS where the interpeter is.
Just start your scripts with

#!/usr/bin/perl5.10.0

or

#!/usr/bin/perl5.8.8

depending on which interpreter you want to use.

If you install something from CPAN, it will automatically be installed
for the interpreter you use for the installation.

What is left is manually invoking perl - I usually do this only when
debugging (perl -d script) or when installing my own modules (perl
Build.PL or perl Makefile.PL). In this case you can either get into the
habit of invoking the interpreter you want (perl5.8.8 -d script) or put
a symlink perl -> /usr/bin/perl5.8.8 in a personal directory (I
use $HOME/bin) and put that at the front of the path.

hp
 
B

brian d foy

greymaus said:
I have perl 5.8.8, instaled 5.10, had some small problems with it, so I
wemt back to 5.8.8 (ln /usr/bin/perl5.8.8 /usr/bin/perl). Now, I want to
do some work with 5.10. How do I get the system to have one user have
perl->perl5.10.0 and the rest have perl->perl5.8.8.?
Something in his/her .profile ?

That was an article I wrote for the Spring 2008 issue of The Perl
Review :)

Configure and install 5.10 in it's own space. Mostly you have to watch
out for the library directories and not overwriting /usr/bin/perl.

After you have 5.10 installed in it's own directory, you can move,
copy, or link the binary whereever you like.

Good luck :)
 
G

greymaus

Err... no. Not even close.

The simplest answer is to install 5.10 without the /usr/bin/perl alias
(pass -Dversiononly -Uusrbinperl to Configure) and then set up a shell
alias perl => perl5.10.0 for that user. The alternative would be to
install 5.10 somewhere else entirely (like /usr/local, or /opt/perl5.10)
and put that location first in that user's path.

Both of these require that you install perl yourself from source. If
you're installing it from a package system you will need to see if that
package system supports this sort of thing.

Ben
Following all your suggestions, I installed perl10.0 in /home/thisuser/bin
ln'd /home/thisuser/bin/perl to it, and just ran a test
#!/home/thisuser/bin/perl
print "Hi\n"; (works)
(next is to see if it can find the modules, as I have done PERL5LIB in
..profile.

anyway, thanks all!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,773
Messages
2,569,594
Members
45,113
Latest member
Vinay KumarNevatia
Top