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

Hi All Does anyone know how to install a perl module without telnet because my hosting company doesnt allow me to telnet into their system. Thanks Augusto
  • Comment on how to install a perl module without telnet

Replies are listed 'Best First'.
Re: how to install a perl module without telnet
by Juerd (Abbot) on Mar 12, 2002 at 12:13 UTC

    Hi All Does anyone know how to install a perl module without telnet because my hosting company doesnt allow me to telnet into their system.

    Download and unpack the module on your local system. Then, copy (FTP?) the module to a directory on the server, so that Foo::Bar is Foo/Bar.pm.
    If you do this in the same directory as your script, you can use it right away. If not, you'll have to modify @INC. (easiest: use lib 'path';)

    Good luck!

    44696420796F7520732F2F2F65206F
    7220756E7061636B3F202F6D736720
    6D6521203A29202D2D204A75657264
    

      That doesn't always work, especially if the module isn't pure Perl!

      However, if you can run scripts (why else would you be uploading modules? :)), you can always do something whacky like create a CGI to handle all your server-side needs...

      #!/usr/bin/perl use CGI::Carp qw/ fatalsToBrowser /; $|++; print "Content-Type: text/plain\n\n"; system("perl Makefile.PL ..."); # etc.

      ... which should work if a compiler is available, but can get rather tedious; especially if you encounter a lot of errors or need to work around manual interaction.

          --k.


        However, if you can run scripts (why else would you be uploading modules? :)), you can always do something whacky like create a CGI to handle all your server-side needs...

        If you can open sockets for listening, it's easier to get yourself a shell after all ;)

        Besides, installing non-pure-perl modules on a system that you can't easily access is such a hassle I haven't even tried to figure out how it's done. Asking the system administrator to install a specific module works most of the time...

        U28geW91IGNhbiBhbGwgcm90MTMgY
        W5kIHBhY2soKS4gQnV0IGRvIHlvdS
        ByZWNvZ25pc2UgQmFzZTY0IHdoZW4
        geW91IHNlZSBpdD8gIC0tIEp1ZXJk
        

Re: how to install a perl module without telnet
by George_Sherston (Vicar) on Mar 12, 2002 at 12:18 UTC
    I use the following procedure:
    • Click on the link in CPAN and select "Open this file from its current location";
    • Use Webdrive (an ftp client that maps remote computers as additional drives) to connect to my server;
    • Drag 'n' Drop the file Module.pm to a directory on my server (say usr/www/lib;
    • Insert the line use lib '/usr/www/lib' before calling the module.
    Of course, if you don't have Webdrive, you wd have to save the file from the module by dragging 'n' dropping to your desktop or wherever, and then use whatever ftp client you have to upload it.

    This is a pretty Windoze-oriented way to do things, and it only works for "pure" Perl modules, but when it works it's very easy.

    § George Sherston
      What do you do if you can't use Telnet OR ftp? I log on to the net from work and they won't allow either. All my up/downloading is done via http.
        katgirl wrote:
        What do you do if you can't use Telnet OR ftp? I log on to the net from work and they won't allow either. All my up/downloading is done via http.


        Use SSH. <evilgrin>

        Seriously, I'm not sure you will be able to install Perl modules simply through http, unless you already happen to have some sort of application on the server which accepts your upload and installs as appropriate.

        There are ways you could automate the task, "webbased perl installer", and an "email command installer" are first to come to mind, but all require shell access to the server, at least initially to setup the environement, if you know what I mean.

        Good Luck
        This is not the "be all, end all" for your dilemma, but it may get you a bit closer. ;) Have a look at this node as they seem to be discussing the prospect of a web-based module installation.
        Perhaps, you could try to install them with ppm or the module CPAN by a cgi-script. But there are several problems to solve:
        • For installation of most modules, you probably need root access. Perhaps, you could do so with sudo or the like (don't know about).
        • Then do try to execute some commands, e.g.:
          unless (open (PPM, "ppm install My::Module 2>&1 |")){ print "Error in executing ppm: $!\n"; } else { print "The result was: <HR>\n"; print <PPM>; close (PPM); }
          or use perl -MCPAN -e "install My::Module" instead of the ppm install - line. But you may get problems if you have to enter something. Maybe you could use the module Expect instead of the simple pipe-open...
        • Take care that nobody else can execute this cgi-script (e.g. with .htaccess)
        But I have never tried to do it this way.

        Best regards,
        perl -e "s>>*F>e=>y)\*martinF)stronat)=>print,print v8.8.8.32.11.32"