How to install Perl and Its modules in Linux

Source: Internet
Author: User
Tags install perl
Article Title: how to install Perl and Its modules in Linux. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Both Linux and perl are free software. It is amazing to combine them. Follow these steps to install perl in linux.

1. obtain the latest perl version. The current version is 5.6.0, that is, stable.tar.gz.

2. Unpack the package:

Gunzip stable.tar.gz

Tar xvf stable.tar

Get catalog perl-5.6.0

3, install perl under 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 of the previous installation.

Delete it.

Sh Configure-de is installed with the default configuration. Generally, it will be OK.

After installation, the directory where perl is located is/usr/local/lib/perl5, And the perl execution File

In/usr/local/bin.

4. About the. html file

The. html file cannot be installed automatically when perl is installed, with one in the perl-5.6.0 directory

Run perl installhtml -- help

You can get help to use

Installhtml can compile the. pod and. pm files to obtain the corresponding. html file.

For more information, see.

The following is a program I wrote 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 obtain a target directory consistent with the source directory structure, including the corresponding. html file

.

Note: The above two methods will generate a row-class error that cannot be converted. In fact, it is irrelevant.

Can be ignored.

5. Module Installation

Gunzip Module.tar.gz

Tar xvf Moudle.tar

Go to the corresponding directory

Perl Makefile. PL

Make

Make test

Make install

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

Files cannot be installed automatically. You need to install them using the method described earlier.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.