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

Hi! I need to place my Perl scripts on any (preferably) free (sub)domain on the internet so the teacher can check them (well and for my future use too) so i registered one at Freehostia.com but i need to make some non-standard modules like URI::fetch available for my scripts Since they do not want to install it for me, Can i bundle those upp somehow? Hope for your help guys, Alexander

2006-10-12 Retitled by g0n, as per Monastery guidelines
Original title: 'web hotels without all modules'

  • Comment on loading Perl modules onto virtual web host

Replies are listed 'Best First'.
Re: loading Perl modules onto virtual web host
by madbombX (Hermit) on Oct 11, 2006 at 01:23 UTC
Re: loading Perl modules onto virtual web host
by monarch (Priest) on Oct 11, 2006 at 10:00 UTC
    I used to use a provider called http://ipowerweb.com. They were pretty good, actually, and the reason I don't use them any more was because I wanted the power and flexibility (e.g. dns, mod_perl) of having my own virtual linux node (at http://www.linode.com/).

    I got a few Perl applications going on http://ipowerweb.com like twiki which required additional CPAN modules.

    What I would do is download the necessary CPAN modules onto my local machine and make the module. Note that you MUST build a Perl version as binaries are unlikely to work on a remote virtual host.

    Next, I would bundle up my modules into a particular location, and FTP them onto my virtual server (e.g. into the /home/myusername/perllib/ directory).

    Lastly I would ensure my Perl script would have a

    use lib '/home/myusername/perllib';
    statement so that Perl would know where to find my modules.

    In the case of twiki, which already has several Perl modules that are used by the application, I bundled my CPAN modules into the same directory as those that came with the application and ensured the library path was correctly set in the application configuration file.

      Actually another trick to be aware of is the fact that some providers (like http://ipowerweb.com) permit you to upload a .htaccess file.

      How would this be a help? Well..

      You can set up a .htaccess file in the directory that your script is located, then set the PERL5LIB environment variable to point to the directory in which you stored your uploaded (FTP'd) CPAN modules. In particular, look into the SetEnv directive.

      At a guess I would suggest a .htaccess file that looks like:

      <Files ~ "\.pl$"> Options +ExecCGI SetHandler cgi-script SetEnv PERL5LIB /home/myusername/myperl/lib </Files>
        Than you very much moarch! I knew there have to be a way to fix this without having ssh access there. The only thing left now is to find out how to build Perl version :). /Alexander