Posts with the tag 'CPAN'

error – expat.h: No such file or directory

While trying to get a perl utility working, I had to install a bunch of prerequisite perl modules on my CentOS 5 VPS. One requirement was XML::Parser. However when I tried to install it like so:
[root@localhost]perl -MCPAN -e shell
cpan> install XML::Parser
I received errors with the below being the most relevent bit…
cp Expat.pm ../blib/lib/XML/Parser/Expat.pm
/usr/bin/perl [...]

1 comment 二月 12th, 2010

cpan 更新 中国镜像 加速安装模块[zt]

使用cpan,大概进去后,help一下就会用。
但是今天想安装Chart::OFC的时候还是碰到问题。
不知道为什么我的一台老的rhel3的系统里的urllist竟然是ftp://cpan.cse.msu.edu/,半天一个i Chart::OFC的命令也没有反应,速度太慢了,后来查了一下那个大学是密歇根州立大学,好偏远,于是必须更新一下urllist,但是我又忘了怎么更新了。
好在网上找到个帖子(http://mail.pm.org/pipermail/china-pm/2007-August/001002.html)告诉了我,转到如下:
你无需手工修改 /etc/perl/CPAN/Config.pm 来改变 CPAN 镜像地址的,以ROOT身
份运行:
# perl -MCPAN -e shell
cpan> o conf urllist unshift  http://www.perl.com/CPAN/
cpan> o conf commit
在search.cpan.org也看到有两个中国的镜像,考虑到稳定性,还是使用perl.com的
还有一点是在用cpan的时候,因为模块安装时默认的make  test不成功,make install就不会去做,但是因为某些情况并不需要这样,这时候,可以force install DBD::mysql
============================================================
配置http_proxy的方法:
o conf http_proxy http://proxy:8080
============================================================
有时候,可能几个不重要的make test中的测试项导致make test失败,这时候就用强制安装:
force install Test::WWW::Mechanize::Catalyst

Add comment 一月 7th, 2010

perl–模块安装方法和常用模块

CPAN(Comprehensive Perl Archive Network)是internet上Perl模块最大的集散地,包含了现今公布的几乎所有的perl模块。网址:http://www.cpan.org/ 
而http://search.cpan.org/,可以查找任何一个模块并提供下载
Linux/Unix—perl模块的安装方法
Linux/Unix下安装Perl模块有两种方法:手工安装和自动安装。第一种方法是从CPAN上下载您需要的模块,手工编译、安装。第二种方法是联上internet,使用一个叫做CPAN的模块自动完成下载、编译、安装的全过程。
A. 手工安装
从CPAN下载了安装模块的压缩文件,假设放在/usr/local/src(一般需要编译安装的软件,都放在此目录下安装)。 
1. cd /usr/local/src   
2. tar xvzf x.x.tar.gz   
3. cd x.x  
4. perl Makefile.PL (生成makefile)
5. make (建立模块)&& make test (测试模块)
如果测试结果报告“all test ok”,您就可以放心地安装编译好的模块了。 
6. make install 
注意:上述步骤适合于Linux/Unix下绝大多数的Perl模块。可能还有少数模块的安装方法略有差别,安装前,先看一下目录里的README或INSTALL。
B. 自动安装: 
安装前需要先联上线,并且您需要取得root权限。 
perl -MCPAN -e shell 
初次运行CPAN时需要做一些设置,如果您的机器是直接与internet相联(拨号上网、专线,etc.),那么一路回车就行了,只需要在最后选一个离您最近的CPAN镜像站点。 
cpan>h (获得帮助) 
cpan>m (列出CPAN上所有模块的列表) 
cpan>install module_name (自动完成从下载到安装的全过程。) 
cpan>q (安装完,后退出)
常用模块:
(1) Net::FTP
(2) Net::Telnet
(3) LWP::Simple, get()
(4) Expect
(5) XML::Simple, XMLin()
(6) Data::Dumper, Dumper()
(7) IO::Socket
(8) Date::Manip, DateCalc(), UnixDate()
(9) Date::Manip, Date_Cmp()
(10) File::Find, [...]

Add comment 十二月 29th, 2009

1 of 11

 

2010年三月
« 二    
1234567
891011121314
15161718192021
22232425262728
293031  

分类目录

标签

书签 优化 参数 命令 啪嗒砰 域名 备份 字体 安装 导入 导出 扩展 换行 文字 正则 爬虫 解决办法 路径 道具 错误 镜像 19楼 Apache awk AWstats CentOS CPAN EditPlus Firefox GD GeoIP Google IBM Linux mysql OUTLOOK Patapon perl photoshop PHP profile rsync sed Shell Thunderbird

最近文章

最近评论

文章索引模板

功能

SEO Powered by Platinum SEO from Techblissonline