Typically, you install a Perl module from source using something like this:
tar zxf Digest-SHA1-2.13.tar.gz
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';
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.
- You're unpacking the tarball archive into the default location;
- You're going into that location, and running the a script that will build a Makefile for your specific installation;
- You're running the Makefile in order to create all of the pieces required for testing and installation;
- You're running the tests, to make sure that the module code works correctly on your specific installation; and finally,
- You're installing the module for use in applications.
Alex / talexb / Toronto
Thanks PJ. We owe you so much. Groklaw -- RIP -- 2003 to 2013.
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link or
or How to display code and escape characters
are good places to start.