首页 » perl » 正文

perl安装

1. wget -O – http://install.perlbrew.pl | bash
2. 在~/.bash_profile中增加如下内容:
source ~/perl5/perlbrew/etc/bashrc
以下在新窗口执行
3. perlbrew list(查看已安装的版本,带*号表示已启用版本)
4. perlbrew available
5. perlbrew install perl-5.14.4
tail -f ~/perl5/perlbrew/build.perl-5.14.4.log (查看安装日志)
perlbrew switch perl-5.14.4
perlbrew list
以下在新窗口执行
6、curl -k -L http://cpanmin.us | perl – -n -S –mirror http://mirrors.163.com/cpan App::cpanminus
cpanm ExtUtils::MakeMaker YAML Getopt::Long::Descriptive Moose Log::Dispatch::FileRotate DBI Date::Parse URI DBD::mysql Date::Simple DateTime::Tiny MRO::Compat
这三个模块可以到http://search.cpan.org/下载,(注意下载连接在右上方,害老子找了好久)

1、将下载下来的文件进行解压
2、根据报错信息,找到perl的目录,查看其它库在哪个目录下,就把解压后的目录复制到该目录下,并且改名。
3、进入目录
生成makefile文件:
# perl Makefile.PL
Checking if your kit is complete…
Looks good
Writing Makefile for Statistics::Descriptive

建立模块:
# make
cp Descriptive.pm blib/lib/Statistics/Descriptive.pm
Manifying blib/man3/Statistics::Descriptive.3pm

测试模块:
# make test
PERL_DL_NONLAZY=1 /usr/bin/perl “-Iblib/lib” “-Iblib/arch” test.pl
descr….ok
All tests successful.
Files=1, Tests=14, 12 wallclock secs (11.37 cusr + 0.16 csys = 11.53 CPU)

安装模块:
# make install
Installing /usr/lib/perl5/site_perl/5.8.0/Statistics/Descriptive.pm
Installing /usr/share/man/man3/Statistics::Descriptive.3pm
Writing /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/auto/Statistics/Descriptive/.packlist
Appending installation info to /usr/lib/perl5/5.8.0/i386-linux-thread-multi/perllocal.pod

发表评论