Click to See Complete Forum and Search --> : [RESOLVED] cheating cpan - "Can't locate loadable object"


theRatWonder
04-20-2007, 12:10 PM
The people who host my web-server are refusing to install a perl module I need, Clone::Fast.

I tried copying Clone/Fast.pm from my perl libraries, a technique which works find on my home version of perl, but if I copy it over to the server I get the error "Can't locate loadable object for module Clone::Fast". Note this is different from the error "Can't locate Clone/Fast.pm" that I would get if it couldn't find the file.

I would imaging it has something to do with this being in the .pm:
use XSLoader;
XSLoader::load( 'Clone::Fast', $VERSION );
because XSLoader apparently "dynamically loads c modules".

There wouldn't be any way around this would there? Like finding the C modules in question and putting them in the folder on the server?

Thanks.
Robin.

Scriptage
04-22-2007, 09:02 AM
This is just a bit of a guess but I would suggest downloading the MakeFile.pl program for Fast::Clone from CPAN here http://search.cpan.org/~jjore/Clone-Fast-0.92/ . If you read the readme it tells you to do the following in command prompt:

perl Makefile.PL
make
make test
make install

I seriously doubt that you can do this via CGI so maybe have a perl program that makes a call to system("MakeFile.pl"); I know that system suspends your current program so that the file opened by system can read from STDIN but I'm not quite sure on the particulars, especially trying to automate it.

Perhaps you could pipe the MakeFile:


open(MAKEFILE, "|MakeFile.pl") || die "Can't open MakeFile: $!";

my $i=0;

while(<MAKEFILE>){
$i++;

if($i == 1){

print STDOUT "make";

}elsif($i == 2){

print STDOUT "make test";

}else{

print STDOUT "make install";

}

}

close(MAKEFILE);



This is untested, I will try this code out as soon as I have access to a computer with PERL on, but this seems like the only way to do it.

Note:

Make sure the tar.gz file contents are placed in the same file as MakeFile.pl on the server.

Kind Regards

Carl

Jeff Mott
04-22-2007, 12:40 PM
RatWonder, the code you copied here is indeed part of the problem. There are some Perl modules that actually use complied C code. For those modules, it's not as simple as copying the PM file. The module must be installed from the server because the C code must be compiled on their machine, for their OS, and with their compiler.

The solution Scriptage posted may allow you to do that. But there's also a good chance it won't. Any decent server will not allow individual accounts to access anything outside the root web directory.

There doesn't seem to be any good reason why your host can't install this module. That reflects very poor service. Your best option might be to threaten to move to another host. And if still nothing is done, then actually move to another host.

theRatWonder
04-23-2007, 03:33 PM
Thanks guys. This is what I thought.

I got round the issue by using the package Clone::PP, which seems to work just as fast, and didn't need any C libraries. It works fine on the server just by copying the files over.