plagger環境構築までの道1 perlbrewで管理者権限が無い環境でも〜

  • perlbrewで環境構築
$ curl -LO http://xrl.us/perlbrew
$ perl perlbrew install
$ ~/perl5/perlbrew/bin/perlbrew init
$ echo "\$HOME/perl5/perlbrew/etc/bashrc" >> ~/.bashrc
$ source ~/.bashrc
$ perlbrew install perl-5.12.1
// $HOME/perl5/perlbrew/build.log にビルドログ
$ perlbrew switch perl-5.12.1
$ source ~/.bashrc
$ perl -v

This is perl 5, version 12, subversion 1 (v5.12.1) built for i686-linux

Copyright 1987-2010, Larry Wall

Perl may be copied only under the terms of either the Artistic License or the
GNU General Public License, which may be found in the Perl 5 source kit.

Complete documentation for Perl, including FAQ lists, should be found on
this system using "man perl" or "perldoc perl".  If you have access to the
Internet, point your browser at http://www.perl.org/, the Perl Home Page.

// なんとなく元を取っておく
$ cp -a ~/perl5/perlbrew/perls/perl-5.12.1{,.o}


 
 

  • 蛇足:インターネット繋がってなくてもperlbrewできる?(今回はあまり追求しない)
    • $HOME/perl5/perlbrew/dists/perl-5.12.1.tar.gz にファイル置く、かつ以下のように変更するとできる?(ひどいやり方)
--- perlbrew    2010-08-20 16:04:05.000000000 +0900
+++ perlbrew.a  2010-08-20 17:05:27.000000000 +0900
@@ -927,11 +927,8 @@
         unless ($dist_git_describe) {
             my $mirror = $self->conf->{mirror};
             my $header = $mirror ? { 'Cookie' => "cpan=$mirror->{url}" } : undef;
-            my $html = $self->_http_get("http://search.cpan.org/dist/$dist", undef, $header);
-
-            ($dist_path, $dist_tarball) =
-                $html =~ m[<a href="(/CPAN/authors/id/.+/(${dist}.tar.(gz|bz2)))">Download</a>];

+$dist_tarball = "perl-5.12.1.tar.gz";
             my $dist_tarball_path = "${ROOT}/dists/${dist_tarball}";
             if (-f $dist_tarball_path) {
                 print "Use the previously fetched ${dist_tarball}\n";