菜鸟表示刚刚接触perl,虽然远古年代接触过一点perl,但毕竟没写过啥东西,再加上当时硬盘吃紧,所以没有装好多模块. 今天运行一个perl,蹦出个错误提示:

.....
Can't locate XML/Writer/String.pm in @INC (@INC contains: /h ...
.....

菜鸟也能看出来是缺少模块了

找了下,解决如下: 1. 进 root

[yu@yu ~]$ su
Password:
  1. 进入cpan 的 shell
[root@yu yu]# perl -e shell -MCPAN

CPAN.pm requires configuration, but most of it can be done automatically.
If you answer 'no' below, you will enter an interactive dialog for each
configuration option instead.

Would you like to configure as much as possible automatically? [yes] yes

 <install_help>

Warning: You do not have write permission for Perl library directories.
...

What approach do you want?  (Choose 'local::lib', 'sudo' or 'manual')
 [local::lib]

Autoconfigured everything but 'urllist'.
........
cpan[0]>
  1. 安装需要的module,比如我这个,按照错误提示应该是 XML/Writer/String.pm 来着 尝试几次,发现直接贴进去就搞定,如下
cpan[4]> install  XML/Writer/String.pm
Running install for module 'XML::Writer::String'
Running make for S/SO/SOLIVER/XML-Writer-String-0.1.tar.gz
....
  /usr/bin/make install  -- OK

完成,善.

References: [1] Can't locate XML/Parser.pm in @INC : http://hi.baidu.com/529970816/item/6b2b3bd3b18a02e6b2f777ea

Categories: Code

Yu

Ideals are like the stars: we never reach them, but like the mariners of the sea, we chart our course by them.

1 Comment

飛天鼠 · February 22, 2013 at 17:09

Google Chrome 24.0.1312.57 Google Chrome 24.0.1312.57 Windows 7 x64 Edition Windows 7 x64 Edition

没用过这个的说- -#

Leave a Reply

Your email address will not be published. Required fields are marked *