寻觅生命中的那一片浅草......

用cpan安装Perl相关模块的问题

最近有玩一下Perl,想用一下cpan中的一些不错的模块,但安装的过程中老是提示make….  not ok,我的服务器环境是freebsd6.2 (升级过ports) 现在的perl 版本是perl 5.8.8

针对上面的错误我的做法是重装,经过反复的重装,最后终于OK,下面分享一下我的重装过程。

如我要安装HTML::TreeBuilder

第一步:检查一下HTML::TreeBuilder模块是否存在于系统中,运行下面的两个指令,

官方给出的方法:

#perl -MHTML::TreeBuilder -e 1

如果运行上面的命令未有警告的话说明该模块已经安装了,需要看相关的使用说明可以使用下面的命令

#perldoc HTML::TreeBuilder

第二种方法其它已经在上面有提到过,即用查看帮助的方法

#perldoc HTML::TreeBuilder

如果有帮助信息的,则说明已安装,否则未安装

第二步:删除CPAN的配置

#cd /usr/local/lib/perl5/5.8.8/CPAN

#rm -f Config.pm

第三步:重新安装 CPAN

#perl -MCPAN -e shell

运行上面的命令后系统会提示这是首次运行cpan,要做一些设置,一般不知道是什么意思时只需要一直按“回车”即可!

下面贴出我的CPAN配置文件

Config.pm:

[code]

# This is CPAN.pm’s systemwide configuration file. This file provides
# defaults for users, and the values can be changed in a per-user
# configuration file. The user-config file is being looked for as
# ~/.cpan/CPAN/MyConfig.pm.

$CPAN::Config = {
‘build_cache’ => q[10],
‘build_dir’ => q[/root/.cpan/build],
‘cache_metadata’ => q[1],
‘cpan_home’ => q[/root/.cpan],
‘dontload_hash’ => {  },
‘ftp’ => q[/usr/bin/ftp],
‘ftp_proxy’ => q[],
‘getcwd’ => q[cwd],
‘gpg’ => q[],
‘gzip’ => q[/usr/bin/gzip],
‘histfile’ => q[/root/.cpan/histfile],
‘histsize’ => q[100],
‘http_proxy’ => q[],
‘inactivity_timeout’ => q[0],
‘index_expire’ => q[1],
‘inhibit_startup_message’ => q[0],
‘keep_source_where’ => q[/root/.cpan/sources],
‘lynx’ => q[],
‘make’ => q[/usr/bin/make],
‘make_arg’ => q[],
‘make_install_arg’ => q[],
‘makepl_arg’ => q[],
‘ncftp’ => q[],
‘ncftpget’ => q[],
‘no_proxy’ => q[],
‘pager’ => q[more],
‘prerequisites_policy’ => q[ask],
’scan_cache’ => q[atstart],
’shell’ => q[/bin/csh],
‘tar’ => q[/usr/bin/tar],
‘term_is_latin’ => q[1],
‘unzip’ => q[/usr/local/bin/unzip],
‘urllist’ => [q[ftp://cpan.hexten.net/], q[ftp://cpan.hostrack.net/pub/CPAN], q[ftp://cpan.pair.com/pub/CPAN/]],
‘wget’ => q[/usr/bin/wget],
};

[/code]

转载自:http://www.netshark.cn/blog/?p=9

尚无评论

发表评论

2024年五月
« 5月    
 12345
6789101112
13141516171819
20212223242526
2728293031