佳木斯湛栽影视文化发展公司

主頁(yè) > 知識(shí)庫(kù) > cpanm安裝及Perl模塊安裝教程

cpanm安裝及Perl模塊安裝教程

熱門(mén)標(biāo)簽:Win7旗艦版 呼叫中心市場(chǎng)需求 電話(huà)運(yùn)營(yíng)中心 百度AI接口 硅谷的囚徒呼叫中心 語(yǔ)音系統(tǒng) 企業(yè)做大做強(qiáng) 客戶(hù)服務(wù)

cpanm是安裝Perl模塊的最方便的方法。自動(dòng)下載安裝依賴(lài)包。使用CPAN shell或下載源碼包安裝模塊,遇到大量依賴(lài)關(guān)系,非常頭痛。下面就是一例:

安裝MongoDB模塊

復(fù)制代碼 代碼如下:

# perl Makefile.PL
Warning: prerequisite Class::Method::Modifiers 0 not found.
Warning: prerequisite Data::Types 0 not found.
Warning: prerequisite DateTime 0 not found.
Warning: prerequisite DateTime::Tiny 0 not found.
Warning: prerequisite ExtUtils::MakeMaker 6.59 not found. We have 6.30.
Warning: prerequisite File::Slurp 0 not found.
Warning: prerequisite File::Temp 0.17 not found. We have 0.16.
Warning: prerequisite JSON 0 not found.
Warning: prerequisite Moose 0 not found.
Warning: prerequisite Test::Exception 0 not found.
Warning: prerequisite Test::Warn 0 not found.
Warning: prerequisite Tie::IxHash 0 not found.
Warning: prerequisite Try::Tiny 0 not found.
Warning: prerequisite boolean 0 not found.
Writing Makefile for MongoDB

1. 安裝cpanm

cpanm其實(shí)是一個(gè)可執(zhí)行文件而已。將它下載到bin目錄,然后添加執(zhí)行權(quán)限就可以了。

復(fù)制代碼 代碼如下:

# wget http:
//xrl.us/cpanm -O /usr/bin/cpanm; chmod +x /usr/bin/cpanm

2. 使用cpanm安裝模塊

復(fù)制代碼 代碼如下:

# cpanm -h
  -v,--verbose              Turns on chatty output
  -q,--quiet                Turns off the most output
  --interactive             開(kāi)啟交互配置(required for Task:: modules)
  -f,--force                強(qiáng)制安裝
  -n,--notest               Do not run unit tests
  --test-only               只測(cè)試不安裝
  -S,--sudo                 sudo to run install commands
  --installdeps             只安裝依賴(lài)模塊
  --showdeps                只顯示依賴(lài)信息
  --reinstall               重新安裝
  --mirror                  指定鏡像url (e.g. http://cpan.cpantesters.org/)
  --mirror-only             只從鏡像下載
  --prompt                  Prompt when configure/build/test fails
  -l,--local-lib            Specify the install base to install modules
  -L,--local-lib-contained  Specify the install base to install all non-core modules
  --self-contained          Install all non-core modules, even if they're already installed.
  --auto-cleanup            Number of days that cpanm's work directories expire in. Defaults to 7

  Examples:
  cpanm Test::More                                          # install Test::More
  cpanm MIYAGAWA/Plack-0.99_05.tar.gz                       # full distribution path
  cpanm http://example.org/LDS/CGI.pm-3.20.tar.gz           # install from URL
  cpanm ~/dists/MyCompany-Enterprise-1.00.tar.gz            # install from a local file
  cpanm --interactive Task::Kensho                          # Configure interactively
  cpanm .                                                   # install from local directory
  cpanm --installdeps .                                     # install all the deps for the current directory
  cpanm -L extlib Plack                                     # install Plack and all non-core deps into extlib
  cpanm --mirror http://cpan.cpantesters.org/ DBI           # use the fast-syncing mirror

參數(shù)名直接為模塊名稱(chēng)

如,安裝MongoDB模塊

復(fù)制代碼 代碼如下:

# cpanm MongoDB
--> Working on MongoDB
Fetching http://www.cpan.org/authors/id/F/FR/FRIEDO/MongoDB-0.702.0.tar.gz ... OK
Configuring MongoDB-0.702.0 ... OK
==> Found dependencies: DateTime, Tie::IxHash, Data::Types, DateTime::Tiny, Class::Method::Modifiers, boolean, Moose, File::Slurp, Try::Tiny, Test::Exception, ExtUtils::MakeMaker, Test::Warn, File::Temp, JSON
--> Working on DateTime
......  //自動(dòng)解決依賴(lài)模塊

為了加快下載速度, 可以指定使用鏡像,并只從鏡像下載:

復(fù)制代碼 代碼如下:

# cpanm --mirror http:
//mirrors.163.com/cpan --mirror-only MongoDB

3. 刪除模塊

安裝App::pmuninstall模塊:

復(fù)制代碼 代碼如下:

# cpanm App::pmuninstall

4.刪除模塊

復(fù)制代碼 代碼如下:

# pm-uninstall MongoDB

MongoDB.so: undefined symbol: HeUTF8 問(wèn)題解決方案參見(jiàn):https://www.jb51.net/article/56285.htm

您可能感興趣的文章:
  • perl批量查詢(xún)ip歸屬地的方法代碼
  • perl中my和our的區(qū)別分析
  • 解析posix與perl標(biāo)準(zhǔn)的正則表達(dá)式區(qū)別
  • Perl中的正則表達(dá)式介紹
  • 為Java程序員準(zhǔn)備的10分鐘Perl教程
  • Perl內(nèi)置特殊變量總結(jié)
  • Perl Sort函數(shù)用法總結(jié)和使用實(shí)例
  • Perl調(diào)用shell命令方法小結(jié)
  • perl 文件測(cè)試操作符匯總
  • Perl使用nginx FastCGI環(huán)境做WEB開(kāi)發(fā)實(shí)例
  • perl查找進(jìn)程PID的例子
  • Perl一句話(huà)命令行編程中常用參數(shù)總結(jié)
  • Windows和Linux系統(tǒng)下perl連接SQL Server數(shù)據(jù)庫(kù)的方法
  • 7個(gè)perl數(shù)組高級(jí)操作技巧分享
  • Perl函數(shù)(子程序)學(xué)習(xí)筆記
  • Perl Substr()函數(shù)及函數(shù)的應(yīng)用

標(biāo)簽:長(zhǎng)沙 安康 山西 濟(jì)南 喀什 海南 崇左 山西

巨人網(wǎng)絡(luò)通訊聲明:本文標(biāo)題《cpanm安裝及Perl模塊安裝教程》,本文關(guān)鍵詞  ;如發(fā)現(xiàn)本文內(nèi)容存在版權(quán)問(wèn)題,煩請(qǐng)?zhí)峁┫嚓P(guān)信息告之我們,我們將及時(shí)溝通與處理。本站內(nèi)容系統(tǒng)采集于網(wǎng)絡(luò),涉及言論、版權(quán)與本站無(wú)關(guān)。
  • 相關(guān)文章
  • 收縮
    • 微信客服
    • 微信二維碼
    • 電話(huà)咨詢(xún)

    • 400-1100-266
    读书| 开化县| 宜州市| 喀什市| 万源市| 曲靖市| 大新县| 手机| 桓台县| 灵武市| 亳州市| 城口县| 晋宁县| 临安市| 湖南省| 德钦县| 宝坻区| 阿尔山市| 潮州市| 碌曲县| 晋中市| 积石山| 枞阳县| 桐城市| 苏尼特左旗| 永安市| 东丰县| 五峰| 古蔺县| 安吉县| 宽城| 山东| 嘉禾县| 白河县| 巩义市| 措勤县| 垣曲县| 芜湖县| 平阴县| 湖南省| 新郑市|