新聞中心
本文和大家重點討論一下在Linux系統(tǒng)下安裝Perl腳本語言,Linux和Perl都屬于自由軟件,將二者結(jié)合真是妙不可言。遵循以下步驟一般就可安裝好Perl腳本語言,Perl就能在linux下歡唱。

我們提供的服務有:成都網(wǎng)站建設、網(wǎng)站建設、微信公眾號開發(fā)、網(wǎng)站優(yōu)化、網(wǎng)站認證、上虞ssl等。為上千企事業(yè)單位解決了網(wǎng)站和推廣的問題。提供周到的售前咨詢和貼心的售后服務,是有科學管理、有技術(shù)的上虞網(wǎng)站制作公司
在Linux系統(tǒng)下安裝Perl腳本語言
Linux和Perl都屬于自由軟件,將二者結(jié)合真是妙不可言。遵循以下步驟一般就可安裝好Perl腳本語言,Perl就能在linux下歡唱。
1下載Perl腳本語言
http://www.cpan.org/src/README.html取得最新版本的Perl,當前版本為5.6.0,即stable.tar.gz。
2解文件包:
gunzipstable.tar.gz
tarxvfstable.tar
得到目錄Perl-5.6.0
3在目錄Perl-5.6.0下安裝Perl腳本語言:
rm-fconfig.shPolicy.sh
shConfigure-de
make
maketest
makeinstall
config.shPolicy.sh為以前安裝時的配置文件,新安裝或升級安裝時需要將其刪除。
shConfigure-de安裝使用默認配置,一般而言將會ok。
安裝完成后Perl所在目錄為/usr/local/lib/Perl5,Perl執(zhí)行文件在/usr/local/bin中。
4關(guān)于.html文件
安裝Perl時不能自動安裝.html文件,在Perl-5.6.0目錄中有一個installhtml文件,執(zhí)行Perlinstallhtml--help可得到使用幫助,使用installhtml可將.pod及.pm文件編譯得到相應的.html文件文件,它的具體使用請自己看。
下面是我所寫的一個具有類似功能的程序。
- simple_find("5.6.0");#含.pm文件的源目錄
- usePod::Html;
- subsimple_find{
- $sourth="/usr/local/lib/Perl5/5.6.0html/";#含.html的目標目錄
- my($input)=@_;
- my$file;
- $ddir=$sourth.$input;
- $cont=`file$ddir`;
- if($cont!~/$ddir\:\sdirectory/){
- `mkdir$ddir`;
- }
- opendir(md,$input);
- my@file=readdir(md);
- closedir(md);
- @pfile=grep(m/\.pm/,@file);
- my @dfile=grep(!m/\.pm/,@file);
- @dfile=grep(!m/^\./,@dfile);
- foreach$pfile(@pfile){
- $pfile=~/\.pm/;
- $dfile=$`;
- $sfile=$input."/".$pfile;
- $dfile=$sourth.$input."/".$dfile."\.html";
- pod2html(
- "--infile=$sfile",
- "--outfile=$dfile");
- }
- foreach$file(@dfile){
- $vale=$input."/".$file;
- $cont=`file$vale`;
- if($cont=~/$vale\:\sdirectory/){
- simple_find($vale);
- }
- }
- }
使用以上程序得到一個與源目錄結(jié)構(gòu)一致的目標目錄,包含相應的.html文件。
注:使用以上兩種方法都會產(chǎn)生不能轉(zhuǎn)化某行類錯誤,其實它無關(guān)大局,可以忽略。
5模塊安裝
gunzipModule.tar.gz
tarxvfMoudle.tar
轉(zhuǎn)到相應目錄
PerlMakefile.PL
make
maketest
makeinstall
安裝完成后模塊在/usr/local/lib/Perl5/site_Perl目錄中,.html文件不能自動安裝,需使用前面介紹方法進行安裝。
【編輯推薦】
- 術(shù)語匯編 Perl閉包概念解析
- Perl模式匹配參數(shù)使用詳解
- 實例解析Perl多進程技術(shù)的應用
- 學習筆記 Perl split函數(shù)用法指導
- Perl多進程及其和多線程的關(guān)系解析
當前文章:Perl腳本語言在Linux系統(tǒng)下的安裝步驟
轉(zhuǎn)載來源:http://www.5511xx.com/article/djdegdd.html


咨詢
建站咨詢
