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

I have recently aquired a new web hosting (500megs,no bandwidth limits,asp,perl,free DSN setups:$99/yr) provider who is running under the same OS type as me (Windows). This was a decision I made to avoid the whole issue of having to worry about different OS builds of modules (ala 'works on Unix but not Windows'). If the module works on my Windows-based Intranet box, the same module *should* work on my Windows-based Internet host...right?

Unfortuantely, they (and almost everyone else I checked) are running versions of Perl (in the current case: 5.006001) that did not include the DBI module (which I really use a lot) as part of the standard dist nor will the host install anything that didn't come standard with the dist. This is a problem that will escalate soon as I start to use more modules that were "not standard" with the build they have. There is no 'command line access' (telnet, SSH, shell, etc) to install modules directly to the host machine...just FTP access.

Now my question...

I know that I can store/create my own library folder of modules and access them via the use of the use lib "./lib"; (if I name my library location '/cgi-bin/lib'). I would like to know if it is possible, with either CPANPLUS or PPM or any other module installation interface, to redirect the install location of the module files to one I define; the /lib folder on my host system. Sort of a "install this windows module but put it there instead of here" kinda thing.

Along the same lines if remote installations are not possible, how about to a local directory; outside of my Perl installation folder and inside one of my intranet's folders? If so, I could then u/l the /lib folder contents to my site on the remote host machine and have a working module installation there...

On the other hand (and if I figure out how to do it), can someone direct me to a web host that has shell access (or at least a way to install modules via some command line interface). My only requirements are:

Signed,

Desperately trying to accomplish installing *working* modules.

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

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

Replies are listed 'Best First'.
Re: Installing modules to a remote system (of same platform)...possible? Yes, but...
by Aristotle (Chancellor) on Jun 18, 2002 at 05:13 UTC
    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.

      (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

Re: Installing modules to a remote system ...
by talexb (Chancellor) on Jun 18, 2002 at 14:53 UTC
    Having started my computing career doing BASIC on a teletype in 1973, I am a confirmed Command Line kind of guy. Not having command line access is a bit like being in a car that's stuck in third gear -- you do eventually get where you want to go, but the trip is not enjoyable.

    I am in the process of moving a client from Windows NT to Linux (here on pair networks) and I am a happy guy. Instead of the edit/ftp/test cycle I now have the shorter edit/test cycle -- and I can compile first to make sure I don't have any warnings or errors.

    In other words, price doesn't rule when I look at a web hosting organization. If there's no shell access, I'm not interested.

    --t. alex

    "Mud, mud, glorious mud. Nothing quite like it for cooling the blood!" --Michael Flanders and Donald Swann