Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Installation of perl module in some local directory and using it

by phoenix007 (Sexton)
on May 14, 2019 at 14:09 UTC ( #1233761=perlquestion: print w/replies, xml ) Need Help??

phoenix007 has asked for the wisdom of the Perl Monks concerning the following question:

Im new to Installation of perl module in some local directory and using it

What I did is tried to install HTML::TagReader module to tagreader directory. Then exported path to PERLLIB Now question is how to use this module

Commands executed in following order. Please suggest me where im going wrong and how to use installed module ?

tar -xvf HTML-TagReader-1.11.tar.gz cd HTML-TagReader-1.11 perl Makefile.PL INSTALL_BASE=/root/tagreader export PERLLIB=/root/tagreader

Content above restored by GrandFather

Replies are listed 'Best First'.
Re: Installation of perl module in some local directory and using it
by talexb (Canon) on May 15, 2019 at 05:07 UTC

    Typically, you install a Perl module from source using something like this:

    tar zxf Digest-SHA1-2.13.tar.gz cd Digest-SHA1-2.13 perl Makefile.PL make make test make install
    In your case, you would modify the make install line with an installation path -- you could put it under /root, but under /opt might be more appropriate. No, I don't know what environment variable is appropriate -- you might have to update the Makefile to accomplish this. It's open source -- help yourself.

    Then, in order to use this module, installed in a non-standard location, you would just add a use lib line in your code:

    .. use lib '/path/to/your/installation'; use Digest::SHA1;
    and call the module's methods. You probably don't want to mess around setting PERLLIB, as show in your example.

    Above all, it helps to understand the steps that you're taking when installing a module -- this isn't black magic, it's actually quite simple.

    1. You're unpacking the tarball archive into the default location;
    2. You're going into that location, and running the a script that will build a Makefile for your specific installation;
    3. You're running the Makefile in order to create all of the pieces required for testing and installation;
    4. You're running the tests, to make sure that the module code works correctly on your specific installation; and finally,
    5. You're installing the module for use in applications.

    Alex / talexb / Toronto

    Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.

Re: Installation of perl module in some local directory and using it
by Fletch (Chancellor) on May 15, 2019 at 14:02 UTC

    The local::lib module provides a mechanism for pointing things into a local directory that's handy, too.

    The cake is a lie.
    The cake is a lie.
    The cake is a lie.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1233761]
Approved by Corion
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (5)
As of 2021-12-07 18:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    R or B?



    Results (34 votes). Check out past polls.

    Notices?