Hosting Won"t Install Module

Hosting Won"t Install Module

am 07.12.2005 20:28:15 von Mike

If getting the error message: "Can't locate blah/blah.pm in @INC"

I have a module that I'd like to install that the hosting site will
not.

Can I put the module somewhere in my directory structure myself and
call it from my script?

How would I do that? Anyone have an example?

Mike

Re: Hosting Won"t Install Module

am 07.12.2005 21:44:49 von Sisyphus

"mike" wrote in message
news:1133983695.195644.165810@g43g2000cwa.googlegroups.com.. .
> If getting the error message: "Can't locate blah/blah.pm in @INC"
>
> I have a module that I'd like to install that the hosting site will
> not.
>
> Can I put the module somewhere in my directory structure myself and
> call it from my script?
>
> How would I do that? Anyone have an example?
>

See 'perldoc perlmodinstall'.

If it's a pure perl module (no compilation) required then you can just
upload the '.pm' file to /my/perl/directory and start your scripts with:

use lib "/my/perl/directory";

If you do it like that be aware that, for a module called Some::Module,
Module.pm would need to be placed in the /my/perl/directory/Some folder ...
and if the module is named Some::Other::Module, then Module.pm would need to
be placed in /my/perl/directory/Some/Other folder.

Cheers,
Rob

Re: Hosting Won"t Install Module

am 07.12.2005 21:53:20 von Sherm Pendley

"mike" writes:

> I have a module that I'd like to install that the hosting site will
> not.
>
> Can I put the module somewhere in my directory structure myself and
> call it from my script?
>
> How would I do that? Anyone have an example?

You mean, aside from the one in the docs included with Perl?

perldoc -q "own module"

sherm--

--
Cocoa programming in Perl: http://camelbones.sourceforge.net
Hire me! My resume: http://www.dot-app.org

Re: Hosting Won"t Install Module

am 07.12.2005 22:40:44 von Mike

And it it is a blah.tar.gz file I'll have to untar it and compile it.

I bet when I try to compile it then I get a error message saying I am
unauthorized because I think the "make " command attempts to install
it in a central library location.

So I need a module already compiled to place there then, right?

Mike

Re: Hosting Won"t Install Module

am 08.12.2005 00:49:15 von Sisyphus

"mike" wrote in message
news:1133991644.042492.119160@g49g2000cwa.googlegroups.com.. .
> And it it is a blah.tar.gz file I'll have to untar it and compile it.
>

Just because it's a tar.gz doesn't mean that it needs compiling. Generally
speaking, if there are '.xs' and/or '.c' files contained in the tarball, it
needs compiling. Otherwise it doesn't.

> I bet when I try to compile it then I get a error message saying I am
> unauthorized because I think the "make " command attempts to install
> it in a central library location.

Except that, in this case, 'make install' will be trying to install into
/my/perl/directory ... but, yes - you may need 'root' privileges :-)

Best way is to try it and see what problems you get.

>
> So I need a module already compiled to place there then, right?

If it needs compiling, and you can't compile it on the target machine, then
that is right. And, as the perlmodinstall documentation points out, it needs
to have been compiled for that particular target platform.

Which module(s) are you wanting to install ?
What is the OS of the server ?

Cheers,
Rob

Re: Hosting Won"t Install Module

am 08.12.2005 02:04:42 von Big and Blue

Sisyphus wrote:

>
>>I bet when I try to compile it then I get a error message saying I am
>>unauthorized because I think the "make " command attempts to install
>>it in a central library location.

So tell it to put it somewhere else!

perl Makefile.PL LIB=/Somewhere/you/can/put/it
make
make test
make install

Then, at the start of your script:

use lib qw( /Somewhere/you/can/put/it );


--
Just because I've written it doesn't mean that
either you or I have to believe it.

Re: Hosting Won"t Install Module

am 08.12.2005 02:16:21 von unknown

Big and Blue wrote:

>
> Then, at the start of your script:
>
> use lib qw( /Somewhere/you/can/put/it );
>
>

Or, don't change your script at all, but set environment variable
PERL5LIB to /Somewhere/you/can/put/it.

Tom Wyant