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.)


In reply to Building perl! by Tanktalus

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.