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

How do i install a perl module on a remote server using SSH or telnet? Thanks for your reply

20031210 Edit by castaway: Changed title from 'Perl Modules'

  • Comment on Installing perl modules on remote server

Replies are listed 'Best First'.
Re: Installing perl modules on remote server
by Roger (Parson) on Dec 08, 2003 at 23:52 UTC
    There are many ways to install perl modules. The following are a few methods I use often -

    Login TypePackage TypePossible Action
    SSH, telnet, Unix, no internet access from serverSource Packagescp or ftp source package (*.tar.gz) onto remote server, then unpack in a work directory -
    tar -zxvf pkg.tar.gz

    Change into the package directory and
    make Makefile.PL make make install make test
    SSH, telnet, Windows, no internet access from serverBinary Package (ppm)scp or ftp the ppm package onto remote server, set ppm repository to point to work directory on remote server, and ppm --install package. Be sure to read the ppm documentation on ActiveState website here
    SSH, telnet, Windows, has internet on remote serverBinary Package (ppm)Log onto the remote server and ppm --install package.
    SSH, telnet, Unix or Windows, Remote server has no compilerSource Package with XS components Install package by hand -
  • Compile the source package on local machine first (assume of the same architecture)
  • 'Tar' up the compiled binaries
  • ftp/scp onto the remote server
  • Log onto the remote server and unpack the package
  • make install on the remote server (or drop the perl .pm files under perl/site/lib, and XS binaries under perl/lib/auto/...)


      Roger, thanks for this tidy chart. I vote that you turn this into a Q&A or add it to Tutorials. I'm not familiar enough with installing modules to know if there are more iterations, but what I see here looks very helpful.

      —Brad
      "A little yeast leavens the whole dough."
        Hi bradcathey, thanks. ;-) But I would certainly wait a bit longer to see what other more experienced monks think about remote module installation first.

        By the way, tachyon (another Australian? :-D) has written an excellent guide on module installation earlier - A Guide to Installing Modules. I recommend you to read it if you haven't.

Re: Installing perl modules on remote server
by caedes (Pilgrim) on Dec 09, 2003 at 18:47 UTC
    I'm surprised no one has voted for
    perl -MCPAN -e shell
    I don't think this will work on a windows machine though.

    -caedes

      CPAN.pm does in fact work in Windows. It seems to me that CPAN.pm will successfully figure out how to open up and install most (if not all) pure perl packages on Win32.

      For modules that have compilable pieces, however, you will need Visual C++ and the appropriate INCLUDE, LIB, and PATH set up.

      Since ActiveState's ppm repository is a little stale, this is a very good way to get modules if you already have a copy of Visual C++. I wish CPAN modules were more compatible with MinGW instead though -- at least that is free :)

        Well, that is all fine and good but the command given above does not do anything for me on either linux (perl 5.8.0) or win32 (perl 5.6.1 active state build 631). All I get is the command prompt back.

        See (win32):

        C:\Data\Scripts>perl -mCPAN -e "shell" C:\Data\Scripts>perl -mCPAN -e "shell" C:\Data\Scripts>

        Ed

Re: Installing perl modules on remote server
by Anonymous Monk on Dec 08, 2003 at 23:12 UTC
    The same way you install them locally.