How to install Perl and Perl modules in Linux

Source: Internet
Author: User
Tags install perl
Both Linux and perl are free software. it is amazing to combine them. you can install perl by following these steps, and perl will be able to sing in linux. 1. get the latest version

Both Linux and perl are free software. it is amazing to combine them. you can install perl by following these steps, and perl will be able to sing 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:

  1. Rm-f config. sh Policy. sh
  2. Sh Configure-de
  3. Make
  4. Make test
  5. Make install

Config. sh Policy. sh is the configuration file used during previous installation. you need to delete it during new installation or upgrade installation.

Sh Configure-de install and use the default configuration. generally, it will be OK.

After installation, the directory of perl is/usr/local/lib/perl5, and the perl execution file is in/usr/local/bin.

4、about .html files

The. html file cannot be installed automatically when perl is installed, there is an installhtml file in the perl-5.6.0 Directory, run perl installhtml -- help to get help, use

Installhtml can compile the. pod and. pm files to obtain the corresponding. html file. for details about its usage, see. Below is a program with similar functions.

  1. Simple_find ("5.6.0"); # contains. use Pod: Html; sub simple_find {$ sourth = "/usr/local/lib/perl5/5.6.0html/"; # contain. the target html directory 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 and can be ignored.

5. module installation

Gunzip Module.tar.gz tar xvf Moudle.tar

Go to the corresponding directory

Perl Makefile. PL 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.