Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

modules

Status
Not open for further replies.

kevinpham

Programmer
Dec 21, 2001
32
US
Hello,
My host does not have some PERL module is I want.... Can I simply upload all modules i want to a folder and use this

use lib 'path/to/modules/


will it works? or there is any other way??? cheer
kevin
 
You may be able to simply upload a module.pm file for very simple modules. It will depend on the dependencies the module has on the system. If it is completely self-contained, it may work. I don't think there will be many that will work that way.

For most modules,
I think you'll need to be able to 'build' the module on the system on which it will run. You can usually build a local copy of a module in your home directory with a --PREFIX argument to the ./configure step(see the READMEs). If you have command line access via ssh or telnet, then you can do local builds of the required modules and then employ the 'use lib' trick you refer to in your question.

If you can't get to the machine to do the 'local' builds, your options are:
- get with your provider about installing the modules
- get with your provider about getting ssh access
- get another provider
- do without the modules 'hope this helps

If you are new to Tek-Tips, please use descriptive titles, check the FAQs, and beware the evil typo.
 
If you do want to install a module with no prohibitive dependancies (and there are a few - things like date manipulation libraries tend not to rely too much on other modules) and you can upload it to the server, you will probably need to[tt]
push @INC, '/path/to/upload/directory';
require module;
module::import();
[/tt]rather than[tt]
use module;
[/tt] so that perl knows where to find it. "As soon as we started programming, we found to our surprise that it wasn't as
easy to get programs right as we had thought. Debugging had to be discovered.
I can remember the exact instant when I realized that a large part of my life
from then on was going to be spent in finding mistakes in my own programs."
--Maurice Wilk
 
What server type. On UNIX you can install modules anywhere with this telnet command.

perl -MCPAN -e shell
install module 'mymodule'

Now if you are blocked from installing to default location you can edit the MyConfig.pm located in a hidden directory.
Usual path is something like this
/home/yourdirctory/.cpan/CPAN

After you telnet into server do this
ls
cd ./.cpan
ls
cd ./CPAN
ls
If you see your MyConfig.pm file at any point goto CPAN and read the documentation on installing modules.

The MyConfig.pm file has a MakeFileARG parameter that you can set a directory you create.

HTH
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top