这是我前几天在工作中所做的:
1. Obtain perl, e.g. current stable (as of the 12th of Jan 2011):
$ curl http://cpan.perl.org/src/5.0/perl-5.12.2.tar.gz -O
$ gunzip -c perl-5.12.2.tar.gz | tar xvf -
$ cd perl 5.12.2
$ sh Configure -des -Dprefix=~/perl-5.12 # install into ~/perl-5.12
$ make
$ make test
$ make install
2. Configure PATH and cpan config, by putting the following in ~/.bashrc:
export PERL_MM_USE_DEFAULT=1
export PATH=~/perl-5.12/bin:$PATH
export MANPATH=~/perl-5.12/man:$MANPATH # breaks stuff on solaris
Make CPAN slightly nicer to deal with.
$ source ~/.bashrc
$ cpan Bundle::CPAN
$ cpan App::cpanminus
=head2 Deploying to a different machine using the same architecture
Just copy ~/perl-5.12 over to the new machine and put perl-5.12/bin in the $PATH.
然后安装催化剂:
$ cpanm Catalyst::Devel
$ cpanm Catalyst::Runtime
$ cpanm DBIx::Class # gives you sqlite along with it