Yukio has asked for the wisdom of the Perl Monks concerning the following question:

Let us say that I am writing a script that requires the SSL module as part of LWP::Protocol::https (which I am) and it is supposed to run on a remote host (which it is) run by a company that has shown reluctance to install individual modules at the request of their clients (which they have). Let us also say that I am not the smartest monkey in the universe (which I'm definitely not).

Can anyone explain a safe and reliable way of making the functionality of the SSL.pm available to my script directly, considering that this module would be called from a properly installed module? I understand that, theoretically, I am able to roll the code of virtually any .pm into my own scripts and have them work, but I suspect (maybe wrongly) that in order to get SSL functionality, I would probably also have to include all of its parent packages (which would be pretty dumb, I think).

Am I stuck here or is there a monkishly clever way out of this tight little box?

Yukio

Replies are listed 'Best First'.
Re: Pseudo-installing modules
by ducky (Scribe) on Sep 24, 2001 at 04:13 UTC

    If you can place modules somewhere you should be able to use the lib module to add directories to your module search path. Something to the effect:

    use lib qw( /home/foo/perllib/ ) ;
    And then put your modules in that directory.

    HTH

    -Ducky

Re: Pseudo-installing modules
by trantor (Chaplain) on Sep 24, 2001 at 13:48 UTC

    If you have shell access to that machine, you can download the nedded modules, unpack them and then follow the usual procedure with a simple variation:

    • perl Makefile.PL PREFIX=/path/where/you/can/write
    • make && make test && make install

    Don't forget that some modules rely on others in order to work properly, so you'll have to do the same over and over again, potentially.

    Also, some modules require C libraries or non-Perl modules to be present (e.g. openSSL), you can install those following the instructions, usually during the configuration phase you type something like

    ./configure --prefix=/path/where/you/can/write

    then follow the instructions for the Perl module and find out how to specify the path for the required library.

    Finally, as it has already been posted, remeber to update your @INC

    This document can be useful, especially section 7 which deals with CPAN as well.

    And be careful not to run out of your quota :-)

    -- TMTOWTDI

Re: Pseudo-installing modules
by tomhukins (Curate) on Sep 24, 2001 at 14:29 UTC
Re: Pseudo-installing modules
by tommyw (Hermit) on Sep 24, 2001 at 14:17 UTC
    merlyn's got a node (No excuses about not using CGI.pm) which looks like it should be usable within your script, even if you don't have shell access or a home directory. Of course, since it involves inlining the entire module within your script, it could get large and unwieldy. Especially if that module requires others...