http://qs321.pair.com?node_id=699132

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

So I've got a webserver with ftp access only (no shell, no root). I need to drop WWW::Mechanize on it but using the usual unpack + cgi script wont work because Mechanize has a big dependency tree. Is there a way to do this without installing each dependency one by one?
  • Comment on Need to install module, ftp access only

Replies are listed 'Best First'.
Re: Need to install module, ftp access only
by jettero (Monsignor) on Jul 21, 2008 at 19:57 UTC
    If you install each dependency into an alternate dir, then you'd only have the one dir to push...

    I'm not sure that makes it any easier though. Do you have rsync or anything? I believe ftp can be made to do recursive puts, probably filezilla supports it rather well...

    I imagine you could also grep your site install directories off the @INC so CPAN'd install the dependency tree into your alternate location (once specified) automatically.

    -Paul

Re: Need to install module, ftp access only
by pc88mxer (Vicar) on Jul 21, 2008 at 22:16 UTC
    The usual trick is to write a CGI script which does it for you. For instance, you could try:
    #!/usr/bin/perl system("perl -MCPAN -e 'install WWW::Mechanize'");
    This will work if the install procedure can be done non-interactively. You might have to configure your ~/.cpan/CPAN/MyConfig.pm first.
      That was my first thought... mkdir /.cpan: Permission denied at /usr/lib/perl5/5.8.5/CPAN.pm line 1258
        It's trying to install the module somewhere you don't have permission, so you simply need to tell the CPAN module to install it somewhere else. You can either set up an appropriate configuration file, as pc88mxer describes, or else set the PREFIX environment variable to tell the CPAN module where you want it to install the module. See Re^2: Perl module for a sample script.