点击这里给我发消息 点击这里给我发消息
首页 > 行业资讯 > linux>详细内容

Linux操作系统下安装Perl及其模块的方法

添加时间:2010-1-4
    相关阅读: 软件 程序 HTML linux 站长 系统

 Linux和perl都属于自由软件,将二者结合真是妙不可言。遵循以下步骤一般就可安装好perl,perl 就能在linux下欢唱。

    1、取得最新版本的 perl,当前版本为 5.6.0,即 stable.tar.gz。

    2、解文件包:

    gunzip stable.tar.gz

    tar xvf stable.tar

    得到目录 perl-5.6.0

    3、在目录 perl-5.6.0 下安装 perl:

    rm -f config.sh Policy.sh

    sh Configure -de

    make

    make test

    make install

    config.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= Linux操作系统下安装Perl及其模块的方法 - 站长学院

咨询热线:020-85648757 85648755 85648616 0755-27912581 客服:020-85648756 0755-27912581 业务传真:020-32579052
广州市网景网络科技有限公司 Copyright◎2003-2008 Veelink.com. All Rights Reserved.
广州商务地址:广东省广州市黄埔大道中203号(海景园区)海景花园C栋501室
= 深圳商务地址:深圳市宝源路华丰宝源大厦606
研发中心:广东广州市天河软件园海景园区 粤ICP备05103322号 工商注册