修改CPAN配置文件

简介:

root用户路径:/root/.cpan/CPAN/MyConfig.pm
一般用户(本例为abc)路径:/home/abc/.cpan/CPAN/MyConfig.pm

查看配置的指令:

        第一步,输入cpan

        第二步,看到cpan>提示符,输入o conf

 

修改2处配置如下:

 1) 'http_proxy' => q[http://192.168.1.2:8080],  此处与浏览器代理配置相同

 2) 'urllist' => [q[http://www.cpan.org/]],      此处配置能访问到的网址

自动安装举例:cpan Spreadsheet::ParseExcel

自动安装的好处是能自动识别依赖关系,对于依赖关系很深的情形,能够显著节约时间,确保安装成功。

 

MyConfig.pm文件内容如下:

[root@localhost CPAN]# cat /root/.cpan/CPAN/MyConfig.pm

 
  1. $CPAN::Config = {  

  2. 'applypatch' => q[],  

  3. 'auto_commit' => q[0],  

  4. 'build_cache' => q[100],  

  5. 'build_dir' => q[/root/.cpan/build],  

  6. 'build_dir_reuse' => q[0],  

  7. 'build_requires_install_policy' => q[yes],  

  8. 'bzip2' => q[/usr/bin/bzip2],  

  9. 'cache_metadata' => q[1],  

  10. 'check_sigs' => q[0],  

  11. 'colorize_output' => q[0],  

  12. 'commandnumber_in_prompt' => q[1],  

  13. 'connect_to_internet_ok' => q[1],  

  14. 'cpan_home' => q[/root/.cpan],  

  15. 'ftp_passive' => q[1],  

  16. 'ftp_proxy' => q[],  

  17. 'getcwd' => q[cwd],  

  18. 'gpg' => q[/usr/bin/gpg],  

  19. 'gzip' => q[/bin/gzip],  

  20. 'halt_on_failure' => q[0],  

  21. 'histfile' => q[/root/.cpan/histfile],  

  22. 'histsize' => q[100],  

  23. 'http_proxy' => q[http://192.168.1.2:8080],  

  24. 'inactivity_timeout' => q[0],  

  25. 'index_expire' => q[1],  

  26. 'inhibit_startup_message' => q[0],  

  27. 'keep_source_where' => q[/root/.cpan/sources],  

  28. 'load_module_verbosity' => q[none],  

  29. 'make' => q[/usr/bin/make],  

  30. 'make_arg' => q[],  

  31. 'make_install_arg' => q[],  

  32. 'make_install_make_command' => q[/usr/bin/make],  

  33. 'makepl_arg' => q[],  

  34. 'mbuild_arg' => q[],  

  35. 'mbuild_install_arg' => q[],  

  36. 'mbuild_install_build_command' => q[./Build],  

  37. 'mbuildpl_arg' => q[],  

  38. 'no_proxy' => q[],  

  39. 'pager' => q[/usr/bin/less],  

  40. 'patch' => q[/usr/bin/patch],  

  41. 'perl5lib_verbosity' => q[none],  

  42. 'prefer_external_tar' => q[1],  

  43. 'prefer_installer' => q[MB],  

  44. 'prefs_dir' => q[/root/.cpan/prefs],  

  45. 'prerequisites_policy' => q[follow],  

  46. 'scan_cache' => q[atstart],  

  47. 'shell' => q[/bin/bash],  

  48. 'show_unparsable_versions' => q[0],  

  49. 'show_upload_date' => q[0],  

  50. 'show_zero_versions' => q[0],  

  51. 'tar' => q[/bin/tar],  

  52. 'tar_verbosity' => q[none],  

  53. 'term_is_latin' => q[1],  

  54. 'term_ornaments' => q[1],  

  55. 'test_report' => q[0],  

  56. 'trust_test_report_history' => q[0],  

  57. 'unzip' => q[/usr/bin/unzip],  

  58. 'urllist' => [q[http://www.cpan.org/]],  

  59. 'use_sqlite' => q[0],  

  60. 'version_timeout' => q[15],  

  61. 'wget' => q[/usr/bin/wget],  

  62. 'yaml_load_code' => q[0],  

  63. 'yaml_module' => q[YAML],  

  64. };  

  65. 1;  

  66. __END__  

查看perl模块信息(按ESC后,输入:q退出):

perldoc perllocal




 本文转自 ztfriend 51CTO博客,原文链接:http://blog.51cto.com/idata/940151,如需转载请自行联系原作者

相关文章
|
7月前
|
XML JSON Java
04SpringBoot配置文件
04SpringBoot配置文件
20 0
|
13天前
|
弹性计算 运维 Shell
|
17天前
|
数据库
【SSM】如何修改配置文件重启项目
【SSM】如何修改配置文件重启项目
10 1
|
8月前
|
存储 安全 API
【详解配置文件系列】es7配置文件详解(下)
【详解配置文件系列】es7配置文件详解(下)
|
8月前
|
存储 网络协议 网络安全
【详解配置文件系列】es7配置文件详解(上)
【详解配置文件系列】es7配置文件详解
一键修改配置文件
import java.io.File; import java.io.FileOutputStream; import java.io.FileReader; import java.
1046 0