http://www.perlmonks.org?node_id=976457

As it is sometimes advantageous to have more than one perl around, and I didn't know about perlbrew when I started doing this, I simply downloaded each new version of perl to ~/perl, extracted it (which would create a perl-$^V sub directory, e.g., perl-5.16.0), and went in and configured it. Eventually I wrote this script to help. And when my hard disk started failing and I replaced it with both a spinning disk and an SSD, I simply modified this script to install to /opt instead of /home (/home being on the spinning disk), and now perl even loads faster :-) I've named this "myconfigure" and put it in ~/perl. So I still download the new version and put it in my ~/perl directory, cd in, and run "../myconfigure". When it's done, the new version is installed to /opt/myperl/$^V. (Ok , not $^V, but substr($^V,1))

#!/usr/bin/perl use File::Basename qw(dirname); use File::Spec; use Cwd; my $dir = Cwd::cwd; my ($version) = $dir =~ /-(5\.\d+\.\d+.*)$/; unlink qw/config.sh Policy.sh/; my @opts = qw( -desr ); my @defs = qw( use64bitall usethreads ); push @defs, "prefix=/opt/myperl/" . $version; system '/bin/sh', 'Configure', @opts, (map { "-D$_" } @defs); die "Failed to configure: $?" if $?; system make => '-j7'; system 'make' if $?; # sometimes make fails with -j7, so this will fin +ish it. die "Failed to make: $?" if $?; $ENV{TEST_JOBS} = 5; system make => 'test_harness'; die "Failed to test: $?" if $?; system make => 'install'; die "Failed to install: $?" if $?;
Note: if you're also going to use this for dev releases (e.g., 5.17.1), you'll have to add usedevel to @defs.

This is using the system perl to build private perls. Much like perlbrew, really, though this has much less "policy" attached. I'm hoping to start shipping perl with my product which means putting perl into our source control, which means automated building. And this will be the start of it. (Well, that and a previous CUFP which then installs arbitrary modules to it as well, so I can also install all my favourite/required CPAN modules also from source control and not from CPAN directly making upgrading a manual step with lawyers being kept at bay.)