首页 | 新闻 | 交流 | 问吧 | 文档 | 手册 | 下载 | 博客

源码编译新版perl和cpan

作者:  时间: 2010-11-10

安装perl5.12.2:
tar xf perl.tar.gz
cd perl.***
./Configure -des -Dprefix=/usr/local/perl5.12.2 -Dusethreads -Uinstalluserbinperl
make
make test
make install

检查是否支持多线程:
/usr/local/perl5.12.2/bin/perl -MConfig -e 'if($Config{useithreads}) {printf("Hello ithreads\n")}elsif($Config{use5005threads}){printf("Hello 5005threads\n")}else {printf("Can not support thread in your perl environment\n");exit(1);}'

安装cpan:
tar -zxvf CPAN-1.9402.tar.gz
cd CPAN-1.9402/
/usr/local/perl5.12.2/bin/perl Makefile.PL
make
make test
make install
/usr/local/perl5.12.2/bin/cpan