CPANM是安裝Perl模塊最方便的方法,自動下載和安裝依賴項包。使用cpan shell或下載源程序包來安裝模塊,您會遇到很多依賴項,并且頭疼,下面武林技術頻道就為大家?guī)韈panm安裝及Perl模塊安裝教程。
下面就是一例:
安裝MongoDB模塊
?
?
1. 安裝cpanm
cpanm其實是一個可執(zhí)行文件而已。將它下載到bin目錄,然后添加執(zhí)行權限就可以了。
?
?
2. 使用cpanm安裝模塊
?
?
? 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ù)名直接為模塊名稱
如,安裝MongoDB模塊
?
?
為了加快下載速度, 可以指定使用鏡像,并只從鏡像下載:
?
?
3. 刪除模塊
安裝App::pmuninstall模塊:
?
4.刪除模塊
?
?
以上就是武林技術頻道小編為大家?guī)淼腸panm安裝及Perl模塊安裝教程,如果你想了解更多的信息,請繼續(xù)關注我們的網(wǎng)站吧!
新聞熱點
疑難解答
圖片精選