Build and Install a PERL module

来源:互联网 发布:my little pony 知乎 编辑:程序博客网 时间:2024/05/22 00:18


1. Build & Install


For example we are going to install Template Perl module under directory ~/tools/perlmodule


  1. Download Template-Toolkit-2.24.tar.gz
  2. Unzip Template-Toolkit-2.24
  3. perl Makefile.PL PREFIX=~/tools/perlmodule
  4. make
  5. make test
  6. make install


2. How to use


In order to use Template module, you must have following 2 statements in your perl file (.pl):

  1. use lib '~/tools/perlmodule/lib64/perl5/site_perl/5.8.8/x86_64-linux-thread-multi';
    • # the path where Template.pm can be found
  2. use Template;
    • # to search Template.pm file


Or you can use environment variable PERL5LIB to set the module search path.

  1. export PERL5LIB=~/tools/perlmodule/lib64/perl5/site_perl/5.8.8



0 0
原创粉丝点击