菜鸟表示刚刚接触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

来自的你,很高兴你能看到这儿。若本文对你有所用处,或者内容有什么不足之处,敬请毫不犹豫给个回复。谢谢!