How to Change which Perl binary to use
Hi,
I have two perl binaries .. one in /usr/local/bin and another in $HOME/bin/perl5/bin I want to use the second perl binary as default. I have added the path of the second perl5 bin directory to $PATH. But when I am doing 'which perl' it is still picking up from /usr/local/bin.... Can someone tell me how to change which default binary to pick ?? |
Question, what is the difference between the two?
|
The two binaries are of different versions.. I needed the latest version. I am running a script which uses the default perl binary... I can't change the script... What I want is to pick this new perl binary instead of the default one...
I also can't change the original Binary(in /usr/local/bin) |
If you change versions, you may break the dependencies. And why can't you change the script? Just edit the shabang.
Incidentally, what have your tried before this? Because google is full of suggestions and answers: http://www.google.co.uk/search?clien...utf-8&oe=utf-8 |
Just add an alias in your .alias
alias perl="/home/you/bin/perl" |
You can apply the following to your perl installations:
I have two versions of tcltk installed on my system. Both binaries live in (in my case) /usr/bin/ Code:
wim@desktop1:~$ ls -l /usr/bin/tclsh* If I want to use it in a script, I'll have to change the shabang as mentioned by jamescondron. Code:
#! /usr/bin/tclsh |
Have you tried placing your $HOME/bin/perl5/bin path before /usr/local/bin?
|
I have put $HOME/bin/perl5/bin before /usr/local/bin and right now I have a strange confusion...
Here are the version numbers... /usr/local/bin/perl - 5.6.1 $HOME/bin/perl5/bin/perl - 5.8.4 Now when I do 'which perl' it is pointing to /usr/local/bin/perl but when I do 'perl --version' it is showing as 5.8.4... Donno the reason.. |
Try which -a.
|
All times are GMT -5. The time now is 07:51 PM. |