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

I've already read related threads like these, but they do not fully capture our situation--

1. Ours is a firewalled machine. No net access. We can ftp files to folders and install modules from there.

2. We have CHMOD 777 for our users on some folders. With this we can install Perl modules if we locally build them by downloading the relevant .pm files. But when these files cannot install, we do not have any cpan or cpanm which would, I think, require net access to install stuff?

I'd like to install, for example, HTML::Restrict. If I do the download + install thing, the Restrict.pm gives me this error:

/lib/HTML/Restrict.PM:328: Unknown command paragraph "=encoding UTF-8"

Reading a bit online suggests that this could be an old Perl problem. We use 5.8.x. Our own dev machines have the luxury of 5.16.x and internet access so installing module is a cinch. Anyway, one of my older machines also has 5.8.x, and installing the module via cpanminus worked there (with internet).

So, question: is it possible to install "cpanminus" (cpanm) through FTP, then upload specific module files to the server through FTP too, and then go into shell and install modules via cpanm by pointing it to respective .pm files?

Thank you for any pointers.

  • Comment on Installing cpan or cpanm modules on a behind-firewall machine with no Internet connection
  • Download Code

Replies are listed 'Best First'.
Re: Installing cpan or cpanm modules on a behind-firewall machine with no Internet connection
by Corion (Patriarch) on Sep 19, 2015 at 10:30 UTC

    App::cpaminus (respectively http://cpanmin.us) is a self-contained single file, so you can copy it as you like.

    For your development environment, I really, really recommend that you have a Perl 5.8.x readily available for testing because 5.8.x is really far behind the times and there are many modules that have problems with the module versions shipped with 5.8. Testing your stuff against 5.8 is important.

    For the long term view on deployment, in your case I would look at CPAN::Mini or Carmel or Pinto to maintain your own curated CPAN mirror that gets synchronized from time to time with the mainstream CPAN but is usable from within your network.

      Thank you. How can I install 5.8 on my local server? I'm on Mac OSX, or Linux. I already have 5.18 on Mac and 5.16 on my Linux box. Is there a way to have two Perl installs on the same server, or downgrade Perl on a box?

        One method for installing multiple Perl versions on the same system would be to use perlbrew.

        In addition to dasgars comments, leave the system/default perl alone. It belongs to the system maintainer/OS vendor. Changing the system perl means that security upgrades to modules will not work anymore or will break your existing installations. Compile your own version(s) of Perl manually or using perlbrew.