http://qs1969.pair.com?node_id=112206

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

I want to use this module on my site, but my web host won't install this module how do I install it locally so I have access to HTML::Template???

Replies are listed 'Best First'.
Re: HTML::Template
by Graham (Deacon) on Sep 13, 2001 at 19:17 UTC
    Firstly, I assume you have some form of shell account on this host so you can install locally.

    perlfaq8 has the answer under How do I keep my own module/library directory?

Re: HTML::Template
by George_Sherston (Vicar) on Sep 13, 2001 at 19:12 UTC
    Get a copy from CPAN, then save it in a directory you do have access to and put
    BEGIN {unshift @INC, 'path'}
    at the start of your script, where "path" is the filepath from where your script is to the directory where you installed the module. @INC contains tells perl where to look for modules that you use, so after you've done that you should be able to call the module the same way you call pre-installed modules.

    Hope that works for you the way it works for me!

    § George Sherston
        Yes, and as princepawn /msg'd me, it also gives access to modules in sub paths, so all round a better answer. Just goes to show, new lessons to be had everywhere :)

        § George Sherston
Re: HTML::Template
by MZSanford (Curate) on Sep 13, 2001 at 19:13 UTC
    you could install the module into a directory under your home directory, and then add a use lib '/home/dir/lib'; line to each script. To install the module in a special place can usually be done with the following (if i recall):
    perl Makefile.PL PREFIX=/home/dir/lib make make test make install

    my own worst enemy
    -- MZSanford
Re: HTML::Template
by Zaxo (Archbishop) on Sep 13, 2001 at 19:15 UTC

    You can install any modules you need in your home directory. You should read the CPAN.pm docs to see how to set up the build environment. That done, say use lib 'wherever'; to include that location in the search path.

    After Compline,
    Zaxo