Welcome 微信登录
编程资源 图片资源库 蚂蚁家优选 PDF转换器

首页 / 操作系统 / Linux / Linux下安装如何Perl

Linux 和 Perl 都属于自由软件,将二者结合真是妙不可言。遵循以下步骤一般就可安装好 perl ,perl 就能在 Linux 下欢唱。1。取得最新版本的 perl,当前版本为 5.6.0,即 stable.tar.gz。2。解文件包:gunzip stable.tar.gztar xvf stable.tar得到目录 perl-5.6.03。在目录 perl-5.6.0 下安装 perl:rm -f config.sh Policy.shsh Configure -demakemake testmake installconfig.sh Policy.sh 为以前安装时的配置文件,新安装或升级安装时需要将其删除。sh Configure -de 安装使用默认配置,一般而言将会 ok 。安装完成后 perl 所在目录为 /usr/local/lib/perl5, perl 执行文件在 /usr/local/bin 中。4。关于 .html 文件安装 perl 时不能自动安装 .html 文件, 在 perl-5.6.0 目录中有一个installhtml 文件, 执行 perl installhtml --help 可得到使用帮助,使用installhtml可将 .pod 及 .pm 文件编译得到相应的 .html 文件文件, 它的具体使用请自己看。下面是我所写的一个具有类似功能的程序。simple_find("5.6.0");# 含 .pm 文件的源目录use Pod::Html;sub simple_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);}}}使用以上程序得到一个与源目录结构一致的目标目录,包含相应的. html文件。注: 使用以上两种方法都会产生不能转化某行类错误,其实它无关大局,可以忽略。5。模块安装gunzip Module.tar.gztar xvf Moudle.tar转到相应目录perl Makefile.PLmakemake testmake install安装完成后模块在 /usr/local/lib/perl5/site_perl 目录中, . html文件不能自动安装,需使用前面介绍方法进行安装。linux安装中分区概念ubuntu 常用命令相关资讯      Perl  Linux教程 
  • Perl的Notepad++环境配置  (04月23日)
  • Perl 若A则B判断的表示方法  (05/28/2015 20:35:30)
  • Perl中的真与假  (02/23/2015 13:21:51)
  • Perl 循环语句  (05/28/2015 20:39:01)
  • Perl 中的正则表达式  (02/23/2015 13:23:42)
  • Perl 5.20.2 发布下载  (02/16/2015 08:43:41)
本文评论 查看全部评论 (0)
表情: 姓名: 字数