校园春色亚洲色图_亚洲视频分类_中文字幕精品一区二区精品_麻豆一区区三区四区产品精品蜜桃

主頁 > 知識庫 > cpanm安裝及Perl模塊安裝教程

cpanm安裝及Perl模塊安裝教程

熱門標簽:外呼電信系統 智能機器人電銷神器 電話機器人哪里有賣 okcc外呼系統怎么調速度 上海企業外呼系統 惠州龍門400電話要怎么申請 熱門電銷機器人 萬利達百貨商場地圖標注 河南虛擬外呼系統公司

cpanm是安裝Perl模塊的最方便的方法。自動下載安裝依賴包。使用CPAN shell或下載源碼包安裝模塊,遇到大量依賴關系,非常頭痛。下面就是一例:

安裝MongoDB模塊

復制代碼 代碼如下:

# 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其實是一個可執行文件而已。將它下載到bin目錄,然后添加執行權限就可以了。

復制代碼 代碼如下:

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

2. 使用cpanm安裝模塊

復制代碼 代碼如下:

# cpanm -h
  -v,--verbose              Turns on chatty output
  -q,--quiet                Turns off the most output
  --interactive             開啟交互配置(required for Task:: modules)
  -f,--force                強制安裝
  -n,--notest               Do not run unit tests
  --test-only               只測試不安裝
  -S,--sudo                 sudo to run install commands
  --installdeps             只安裝依賴模塊
  --showdeps                只顯示依賴信息
  --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

參數名直接為模塊名稱

如,安裝MongoDB模塊

復制代碼 代碼如下:

# 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
......  //自動解決依賴模塊

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

復制代碼 代碼如下:

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

3. 刪除模塊

安裝App::pmuninstall模塊:

復制代碼 代碼如下:

# cpanm App::pmuninstall

4.刪除模塊

復制代碼 代碼如下:

# pm-uninstall MongoDB

MongoDB.so: undefined symbol: HeUTF8 問題解決方案參見:https://www.jb51.net/article/56285.htm

您可能感興趣的文章:
  • perl批量查詢ip歸屬地的方法代碼
  • perl中my和our的區別分析
  • 解析posix與perl標準的正則表達式區別
  • Perl中的正則表達式介紹
  • 為Java程序員準備的10分鐘Perl教程
  • Perl內置特殊變量總結
  • Perl Sort函數用法總結和使用實例
  • Perl調用shell命令方法小結
  • perl 文件測試操作符匯總
  • Perl使用nginx FastCGI環境做WEB開發實例
  • perl查找進程PID的例子
  • Perl一句話命令行編程中常用參數總結
  • Windows和Linux系統下perl連接SQL Server數據庫的方法
  • 7個perl數組高級操作技巧分享
  • Perl函數(子程序)學習筆記
  • Perl Substr()函數及函數的應用

標簽:秦皇島 周口 合肥 綿陽 百色 周口 淮安 綏化

巨人網絡通訊聲明:本文標題《cpanm安裝及Perl模塊安裝教程》,本文關鍵詞  cpanm,安裝,及,Perl,模塊,教程,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《cpanm安裝及Perl模塊安裝教程》相關的同類信息!
  • 本頁收集關于cpanm安裝及Perl模塊安裝教程的相關信息資訊供網民參考!
  • 推薦文章
    主站蜘蛛池模板: 高陵县| 青铜峡市| 明水县| 萍乡市| 罗定市| 黄平县| 马边| 城市| 涡阳县| 凤城市| 楚雄市| 绥化市| 宝坻区| 丰城市| 新干县| 鄂尔多斯市| 井研县| 苗栗县| 汕尾市| 肥西县| 额尔古纳市| 连云港市| 龙岩市| 杨浦区| 额敏县| 安溪县| 阿尔山市| 涞水县| 商河县| 唐河县| 桃园市| 桓仁| 荆州市| 盐池县| 三都| 岚皋县| 禹城市| 贞丰县| 革吉县| 武川县| 勐海县|