Forum Moderators: coopster & phranque

Message Too Old, No Replies

Installing a CPAN Module

         

rainborick

5:31 pm on Jun 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm trying to install a CPAN module into my website's local cgi-bin directory and I just can't seem to translate the common documentation into something I can use online. I have unzipped the module files, and executed the accompanying Makefile.pl, and it looks to me like I got the correct PREFIX setting in the resulting "Makefile". But that's where I'm stuck. I need to simulate the common CPAN command-line commands:

% make
% make test
% make install

remotely. I think I should be able to write a Perl script to execute these commands, right? Host is running FreeBSD/Apache. I would appreciate any help. Thanks!

wruppert

9:28 pm on Jun 26, 2005 (gmt 0)

10+ Year Member



Here is an article at Pair about how to install a CPAN module into your own account on one of their shared servers. They use FreeBSD/Apache as well, it may be relevant to you. I haven't done it myself yet, but I will be soon.

[pair.com...]

rainborick

9:53 pm on Jun 26, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I'm grateful for the reference, but it is specific to that host. The page had some information that I might be able to use. I think I can use a Perl script to issue the needed system commands and the article had some hints.

But please, if anyone has installed a CPAN module in a local directory on a remote host, I'd really appreciate any help. Thanks!

SeanW

2:39 am on Jun 27, 2005 (gmt 0)

10+ Year Member



Oh, you want to run it remotely AND install into a different directory. How about a shell script running as a CGI?

#!/bin/sh

echo "Content-type:text/html"
echo
echo '<pre>'

cd /home/mydir/public_html/cgi-bin/mymodule
LIB=/home/mydir/
perl Makefile.PL
make
make test
make install

rainborick

1:51 pm on Jun 27, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Thanks for the tip. I knew there had to be a way.

I also learned something in the Perl Modules newsgroup that helped. My hosting service's advice was to install the module (or more precisely the .pm script) in a local directory and rely on "use lib '/www/xyz/modules'". My first attempts failed, and added to my general lack in confidence in the support staff's advice about Perl, I thought there had to be more to it. And I was sort of right. Apparently some modules do not need to be pre-compiled with Make. So I went back and found a prior mistake and, sure enough, I can access this particular module without using Make. However, I'm finding more functions I need that are not in this module, so I'm incredibly relieved to have a method of installing all modules. Again, I truly appreciate the help.