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

I'm just beginning to come into a place where I am interested in making code not just for my own projects, but for eventual release into the wider world. As I've learned a lot in the last few months about coding (lots from this here place), many of the useful things I've learned involve using modules, which I think are the "bees knees", honestly.

I'm a web programmer. One of the things that interests me the most these days is making scripts that people who are using virtual hosts can just ftp to their cgi-bin directory, perhaps run a web-based configuration tool if necessary, and then go to work. Even if folks have shell access, and can use the console to install software, they still are at the mercy of their hosts in terms of the modules that might, or might not be installed.

So what is a good way to get around this? Are there ways to include modules in makefiles? (I haven't yet gotten to trying to put makefiles together, so a RTFM response to this question is certainly appropriate, if the M exists somewhere.)

Thank you kindly.

Replies are listed 'Best First'.
Re: Perl Modules vs generalization
by Masem (Monsignor) on Apr 13, 2001 at 16:54 UTC
    Most perl modules can be installed into an alternative locations, via the use of "use lib" or other similar modifications. Assuming that what you are trying to do is allow users to simply drop in the code and necessary supports, I would try to work with modules that have a GPL-like license or similar that allows free distribution of that module code. Thus, you can now provide your users with a tar-ball of not only your code, but the modules that you need. The extra modules would then sit within the user's directory on the virtual host.

    You can easily check for the existence of a module in a pre-install script to decide if it's need, possibly by the use of automake/autoconf, or even via makefiles though you'll need to do a few tests to make sure that work, or you can let the user decide to use that support module if necessary via your web-config idea.


    Dr. Michael K. Neylon - mneylon-pm@masemware.com || "You've left the lens cap of your mind on again, Pinky" - The Brain
(jeffa) Re: Perl Modules vs generalization
by jeffa (Bishop) on Apr 13, 2001 at 17:46 UTC
    sorry, bad info

      It's not necessary to have root access in order to install a module. You can install modules in any directory you like as long as you have read/write permissions. All that's required is to supply the proper PREFIX value to make at build time. You may then use:

      use lib 'mydir';

      to add the install directory to @INC.

      Update:

      Added 'use'. I knew I should have taken the day off. Thank you, merlyn.