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

Hi all, I got a different non-code question. I have a shared "virtual" host and i cannot afford a dedicated one. I do not have javascript.pm installed on my host and they will not install it for me and i have no access to install it either. i downloaded what i think is javascript.pm called Data-JavaScript-1.03 "Data::Javascript" . Now is there a way i can use this file without being able to actually install it on my host? thank you, Adam

  • Comment on javascript, javascript.pm, data::Javascript, cgi, installing, using, perl module from cpan

Replies are listed 'Best First'.
Re: javascript, javascript.pm, data::Javascript, cgi, installing, using, perl module from cpan
by akm2 (Scribe) on Mar 26, 2001 at 18:49 UTC

    Sure Adam, you can always use any Perl Module you like. Even if your ISP wont install the module for you. Here is what you do.

    1. Download the module.
    2. Create A new directory on your server (I would suggest somthing like: perlmods/The Module Name Here/).
    3. Decompress the module you downloaded (if needed).
    4. Upload *ALL* the decompressed files to the directory you created on the server.
    5. Make sure the directory & the files you put on the server have Read, Write & Execute permissions, if your server requires to set permissions.
    6. Add

    use lib '~myname/path/to/perlmods/The Module Name Here'; use javascript;
    to the script you want to use the module.

    use lib simply adds the list of paths that you specify to the front of @INC and thus they get searched first for any modules. While you can't easily maintain the modules with CPAN, you can still grab the source for each, and specify YOUR directory for all install work.

      Simply uncompressing module tarballs or .zip files and putting them in a particular place isn't always going to do the job right. There's a standard procedure for installing Perl modules, and there's no problem with installing them into any directory to which you have write permissions.

      perl Makefile.PL PREFIX=path/to/my/modules make make test #(optional) make install

      The <coe>PREFIX</code> argument to Makefile.PL is the key here; if you omit it, the installation will point to the system-wide @INC directories, which are usually (because they ought to be) only writeable by the superuser. See your system's perldoc perlmodinstall for more goodies like this.

      Philosophy can be made out of anything. Or less -- Jerry A. Fodor

Re: javascript, javascript.pm, data::Javascript, cgi, installing, using, perl module from cpan
by azatoth (Curate) on Mar 26, 2001 at 13:14 UTC