Gossamer Forum
Home : General : Perl Programming :

How to install Perl modules without root acess?

Quote Reply
How to install Perl modules without root acess?
  Can someone tell me? Or where I can find a FAQ or tutorial on this?
Quote Reply
Re: How to install Perl modules without root acess? In reply to
   Thank you!
I will test it now...
Quote Reply
Re: How to install Perl modules without root acess? In reply to
Hi!

I didn't test this solution, since I have root access to my server, but I think it's gonna work.

1- Create a directory "modules" in your server.

2- Install the module like this:
Code:
% perl5 Makefile.PL PREFIX=/path/to/modules
% make
% make test
% make install

3- On the perl script that require the module put this line in the begin of script:
Code:
use lib qw(/path/to/modules);

Once again, I didn't test this solution. I don't know for sure it's gonna work. In number 3, check the modules directory. You may need to use:
Code:
use lib qw(/path/to/modules
/path/to/modules/site_perl);

Another way is to like Alex did in Links2. After steps 1 and 2 go to the "modules" directory and copy the module to same directory you want to run the cgi script and add the following line to your script:
Code:
eval {
($0 =~ m,(.*)/[^/]+,) && unshift (@INC, "$1"); # Get the script location: UNIX /
($0 =~ m,(.*)\\[^\\]+,) && unshift (@INC, "$1"); # Get the script location: Windows \
};
if ($@) {
print "Content-type: text/plain\n\n";
print "Error including libraries: $@\n";
print "Make sure they exist, permissions are set properly, and paths are set correctly.";
exit;
}






------------------
Rogerio Morais
www.rogerle.com


[This message has been edited by Roger (edited June 12, 1999).]