修改perl CPAN模組的設定檔

來源:互聯網
上載者:User

root使用者路徑:/root/.cpan/CPAN/MyConfig.pm

一般使用者(本例為abc)路徑:/home/abc/.cpan/CPAN/MyConfig.pm

修改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

$CPAN::Config = {       'applypatch' => q[],       'auto_commit' => q[0],       'build_cache' => q[100],       'build_dir' => q[/root/.cpan/build],       'build_dir_reuse' => q[0],       'build_requires_install_policy' => q[yes],       'bzip2' => q[/usr/bin/bzip2],       'cache_metadata' => q[1],       'check_sigs' => q[0],       'colorize_output' => q[0],       'commandnumber_in_prompt' => q[1],       'connect_to_internet_ok' => q[1],       'cpan_home' => q[/root/.cpan],       'ftp_passive' => q[1],       'ftp_proxy' => q[],       'getcwd' => q[cwd],       'gpg' => q[/usr/bin/gpg],       'gzip' => q[/bin/gzip],       'halt_on_failure' => q[0],       'histfile' => q[/root/.cpan/histfile],       'histsize' => q[100],       'http_proxy' => q[http://192.168.1.2:8080],       'inactivity_timeout' => q[0],       'index_expire' => q[1],       'inhibit_startup_message' => q[0],       'keep_source_where' => q[/root/.cpan/sources],       'load_module_verbosity' => q[none],       'make' => q[/usr/bin/make],       'make_arg' => q[],       'make_install_arg' => q[],       'make_install_make_command' => q[/usr/bin/make],       'makepl_arg' => q[],       'mbuild_arg' => q[],       'mbuild_install_arg' => q[],       'mbuild_install_build_command' => q[./Build],       'mbuildpl_arg' => q[],       'no_proxy' => q[],       'pager' => q[/usr/bin/less],       'patch' => q[/usr/bin/patch],       'perl5lib_verbosity' => q[none],       'prefer_external_tar' => q[1],       'prefer_installer' => q[MB],       'prefs_dir' => q[/root/.cpan/prefs],       'prerequisites_policy' => q[follow],       'scan_cache' => q[atstart],       'shell' => q[/bin/bash],       'show_unparsable_versions' => q[0],       'show_upload_date' => q[0],       'show_zero_versions' => q[0],       'tar' => q[/bin/tar],       'tar_verbosity' => q[none],       'term_is_latin' => q[1],       'term_ornaments' => q[1],       'test_report' => q[0],       'trust_test_report_history' => q[0],       'unzip' => q[/usr/bin/unzip],       'urllist' => [q[http://www.cpan.org/]],       'use_sqlite' => q[0],       'version_timeout' => q[15],       'wget' => q[/usr/bin/wget],       'yaml_load_code' => q[0],       'yaml_module' => q[YAML],     };     1;     __END__

本文出自 “iData” 部落格,請務必保留此出處http://idata.blog.51cto.com/4581576/940151

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.