Suramya's Blog : Welcome to my crazy life…

September 5, 2005

Some Perl Tricks

Filed under: Tutorials — Suramya @ 8:52 AM

Installing perl modules can be a pain if you don’t have root access on the server you are installing them. However the creators of Perl did think about this and added a PREFIX switch that we can use to give the module an alternate installation directory. So to install the module in /home/suramya/modules the command we would run is:

perl Makefile.PL PREFIX=/home/suramya/modules

Then we follow the regular installation steps of make, make install.

Once the module is installed we need to tell the Perl scripts where to find the new module, there are a number of ways that we can do this but the one I like is modifying the PERL5LIB enviorment variable. This method has the advantage that we don’t need to modify any of the scripts etc.

The easiest way to modify the variable is to add a line that looks like this to your .profile or .bashrc file:

PERL5LIB=/home/suramya/module:/usr/local/lib/perl/5.6.1:/usr/local/share/perl/5.6.1:
export PERL5LIB

Hope this helps someone.

– Suramya

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

Powered by WordPress