views:

93

answers:

2

I'm an absolute beginner at Perl, and am trying to use some non-core modules on my shared Linux web host. I have no command line access, only FTP.

Host admins will consider installing modules on request, but the ones I want to use are updated frequently (DateTime::TimeZone for example), and I'd prefer to have control over exactly which version I'm using.

By experimentation, I've found some modules can be installed by copying files from the module's lib directory to a directory on the host, and using

use lib "local_path";

in my script, i.e. no compiling is required to install (DateTime and DateTime::TimeZone again).

How can I tell whether this is the case for a particular module? I realise I'll have to resolve dependencies myself.

Additionally: if I wanted to be able to install any module, including those which require compiling, what would I be looking for in terms of hosting?

I'm guessing at the moment I share a VM with several others and the minimum provision I'd need would be a dedicated VM with shell access?

A: 

You can use

use lib "your_local_path" , 

In this case , you can have module in your local path.

pavun_cool
Already doing this with the modules I have managed to install -- clarified my question to make this clearer.
e100
+2  A: 

See perldoc perlxs.

You can probably inspect the module's source for DynaLoader or something like this. This way you can find out if a module uses any C code.

If you use a unix-like OS, you can use a package manager to see what files/libraries a package (perl module) installs.

eugene y
Remember I'm a beginner - I can see that doc is about the link between Perl and C, but can't follow much more than that.
e100
Modules that are pure perl (no XS) can just be copied from place to place with no trouble. Modules that use XS won't work when copied unless the source and destination systems have the same CPU, OS, and library versions installed (more or less).
hobbs
@hobbs: Aha - you should put this as an answer.
e100