in reply to Installing modules to a remote system (of same platform)...possible? Yes, but...

You do have some sort of remote access on the machine, if you can upload CGI scripts.. it's awkward, but you can do something like
#!perl -w use strict; $|++; print "Content-type: text/plain\n\n"; print `ppm install Some::Module`;
(Of course you might be able to use ppm directly inside your script, but I don't know if you can integrate calls to it into a script like you can with CPAN.)

ppm has to have some option to let you install things to specified rather than the default directories (which would require Administrator access), and a switch to run non-interactively..

This is just a crutch, but at least it works.

Makeshifts last the longest.

  • Comment on Re: Installing modules to a remote system (of same platform)...possible? Yes, but...
  • Download Code

Replies are listed 'Best First'.
Re: Re: Installing modules to a remote system (of same platform)...possible? Yes, but...
by Kanji (Parson) on Jun 18, 2002 at 10:55 UTC
    (Of course you might be able to use ppm directly inside your script, but I don't know if you can integrate calls to it into a script like you can with CPAN.)

    All ppm (as most of us know it) is a fancy wrapper for PPM.pm (alt.) much like the CPAN(PLUS) shell, so one just needs to use the module directly if you need to embed in, say, a CGI ...

    use PPM; my $ppd = shift; my $dir = 'c:/inetpub/wwwroot/www.foo.com/'; PPM::InstallPackage( package => $ppd, root => $dir, );

    Then it's just a matter of slapping use lib 'c:/inetpub/wwwroot/www.foo.com/site/lib'; to the top of all your scripts.

        --k.


      Okay, I'm game.

      I created a script called 'install_mods.pl' and placed in it the following code:

      use PPM; print "Content-type: text/html\n\n"; BEGIN { use CGI::Carp qw(carpout); carpout(\*LOGGY) if open(LOGGY,'>>'.__FILE__.'.err.log'); } my $ppd = 'd:/html/users/shrumnet/html/cgi-bin/modules/DBI.ppd'; my $dir = 'd:/html/users/shrumnet/html/cgi-bin/library'; print "Installing [<b>$ppd</b>] to [<b>$dir</b>]"; PPM::InstallPackage( package => $ppd, root => $dir, );

      However, this does nothing (no files are written in the /library folder. Additionally, the error log file gets created and in it resides nothing (which is odd as the error log shouldn't get created unless there was an error to write).

      Any suggestions?

      ======================
      Sean Shrum
      http://www.shrum.net

      BTW...

      I also tried: 'my $ppd = 'HTTP://www.ActiveState.com/packages/DBI.ppd';

      ======================
      Sean Shrum
      http://www.shrum.net