Why you might want to do this
Maybe, the perl on the host you are running on, is one you have no control of. It could be that the hosting company or your employer, doesn't allow you root access. Maybe you want a more up to date perl than that provided.
Another reason is to have a "virgin perl" to use with the CPAN testers' YACSmoke programme. There are advantages to using the minimum installation: you'll pick up module dependencies that many smoke testers would miss. This would be completely separate from your "working perl", which has all the modules you need to do your work, and for the sysadmins, and the package installers.
In my case, it's the latter reason. I'm using Debian (Sid actually, and so the perl and packaged modules are pretty up to date), and am setting up two "virgin perls", one with 5.8.8 and one with bleadperl. I've created user accounts specially for the purpose.
I've not tried this on Windows. Maybe it's possible to have a vanilla perl installed elsewhere to C:\Program files
, outside the path for normal operations.
Planning and execution
Decide on where you want to put your perl. In my case, this has involved creating new user accounts. In my case, the perl will live under /home/perl-base
.
Obtain the tarball for the perl you want. Untar this into a build directory. In my case, /home/perl-base/perl-5.8.8
is fine: I untar as user perl-base in the user's home directory. cd into the top level directory.
We're going to vary from the normal mantra given in the INSTALL document. Run the command
./Configure -de
to generate the files config.sh and Policy.sh. If this encounters any problems, BAIL OUT! These would indicate an issue on your O/S platform; most of these have been ironed out over time, but this still could be something worth reporting to p5p via perlbug, especially if you are messing with bleadperl.
We're going to throw away the config.sh, but keep the Policy.sh. Remove config.sh, but edit Policy.sh. Globally replace /usr/local
with your destination install base directory, in my case /home/perl-base
. Uncomment the shell variable lines that you have changed.
Now, run ./Configure
again. In my case I use -de
again as I'm building a perl with default configuration - your mileage may vary.
Run make
, make test
and make install
. You don't need to run the make install
as root.
You may need to edit .bash_profile to add the new bin directory to your path. In my case, the boilerplate .bash_profile contained code to add the user's bin directory to the path if it exists, so I just needed to source in .bash_profile. You might be using a different shell to bash - ymmv.
perl -V
and voilà
If you are using a modern CPANPLUS then you can trick it into using different user configs by setting or changing the APPDATA environment variable.
You can all that by just running Configure once, and no editing of files.
As explained in the INSTALL file, you can give an option to Configure to tell it where to install perl. -Dprefix=/home/perl-base/perl-5.8.8 will do.
I typically run Configure something like this:
./Configure -des -Dusedevel -Dprefix=/opt/perl/5.9.4 -Dusemorebits -Doptimize=-g -Dusemorebits -Uversiononly -Dmydomain=.abigail.be -Dcf_email=abigail@abigail.be -Dperladmin=camel@abigail.be -Dcc=gcc
I need to get around to updating these, but they're still pretty good:
http://use.perl.org/user/jdavidb/journal/6477