ActivePerl在按裝模組方面提供了一個很方便的程式
PPM(Perl Package Manager),
當你安裝好ActivePerl時,
這個程式就已經裝好在你的電腦裡了,
執行PPM的方法是直接在「命令列模式」下輸入PPM後按Enter,
這時會開出一個視窗Title為Perl Package Manager的視窗,



在輸入框裡輸入想要安裝的模組,
這裡以WWW::Mechanize模組為例,
輸入WWW-Mechanize後,就會篩選出符合的模組,
點選輸入框右側的「綠色+號」,
再點選「綠色右方方向鍵」,
這樣就開始安裝了。

有此些模組可能在預設的Repositorise裡找不到,
這時我們就要新增Repositories,
方法是點選「Edit」「Preferences」「Repositories」,
在Name輸入框裡取個名字,
在Location輸入框裡輸入一個連結,例如http://theoryx5.uwinnipeg.ca/ppms/package.lst
然後點選「Add」「OK」就行了。

至於有哪些Repositories的連結可用呢?
可以看一下「Help」「Contents」,
裡面大概提到的連結有
The University of Winnipeg's 5.8 PPM repository
http://theoryx5.uwinnipeg.ca/ppms/package.lst
A repository of Bioperl packages
http://bioperl.org/DIST
Roth Consulting's package repository
http://www.roth.net/perl/packages/
the "Bribes de Perl" (Scraps of Perl) repository (en Français et Anglais)
http://www.bribes.org/perl/ppm/

另PPM也可以直接在命令列模式下執行,如
一、安裝Win32-GUI模組
ppm install Win32-GUI.ppd
二、移除Win32-GUI模組
ppm uninstall Win32-GUI

若不用PPM安裝模組,也可以採Building from source的方式,
下面以安裝Win32-MediaPlayer-0.2為例
一、下載並執行NMake程式
二、下載模組程式Win32-MediaPlayer-0.2模組並解壓縮
三、在命令列模式執行下列步驟
  perl Makefile.PL
  nmake
  nmake install

參考資料:
ActivePerl
Status of the ActiveState PPM Repositories
arrow
arrow
    全站熱搜

    jck11 發表在 痞客邦 留言(2) 人氣()