Novice Academy: Installing Perl and Perl modules under Linux

  
                  

Linux and Perl are both free software, and it's wonderful to combine the two. Perl can be installed by following the steps below, and perl can sing under Linux.

1, get the latest version of perl, the current version is 5.6.0, that is stable.tar.gz.

2, solution package:

gunzip stable.tar .gz


tar xvf stable.tar

Get the directory perl-5.6.0

3, install perl in the directory perl-5.6.0 :

rm -f config.sh Policy.sh


sh Configure -de

make


make test

make install


config.sh Policy.sh is the configuration file for the previous installation, when installing or upgrading the installation

Remove it.

sh Configure -de installation using the default configuration, generally will be ok.


After the installation is complete, the directory where perl is /usr/local/lib/perl5, The perl executable file

is in /usr/local/bin.

4, About .html files


When installing perl, you can't automatically install .html files, there is a

in perl-5.6.0 directory Installhtml file, execute perl installhtml -help to get help, use


installhtml to compile .pod and .pm files to get the corresponding .html file, which has

Please use your own body.

The following is a program I have written with similar functions.

simple_find("5.6.0");# Source directory containing .pm files
use Pod::Html;
sub simple_find{
$sourth="/usr/local/Lib/perl5/5.6.0html/"; #target directory containing .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);
}
}
}

Use the above program to get a target directory consistent with the source directory structure, including the corresponding. Html file.

Note: Using the above two methods will produce a class error that cannot be converted. In fact, it has nothing to do with the big picture and can be ignored.

5, module installation

gunzip Module.tar.gz


tar xvf Moudle.tar

Go to the corresponding directory< Br>

perl Makefile.PL

make

make test

make install

After the installation is complete, the module is in /usr/local/lib/In the perl5/site_perl directory, the .html

file cannot be installed automatically. It needs to be installed using the method described above.

Copyright © Windows knowledge All Rights Reserved