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

I want to install Net::SFTP in our production machines. But I cannot use these commands:
sudo perl -MCPAN -e 'install Net::SFTP' or yum install ...
The problem is that it has a lot of dependencies.

What would be a good approach in dealing with this?
  • Should I download each dependent tarballs and try to install them on my local machine on a local directory? Then zip this local directory and deploy it to production?
  • Should I try to download the rpms and hope that there are rpm for all the dependencies?
  • Replies are listed 'Best First'.
    Re: Bundling the Module Net::SFTP
    by Corion (Patriarch) on Sep 09, 2010 at 17:00 UTC
        The other factor that I forgot to mention is that the production machine do not have access to the Internet. So, I am not sure how your suggestion would work.

        Are you saying that I should download all the dependent modules and just install them locally as non-root?

          Yes.

    Re: Bundling the Module Net::SFTP
    by salva (Canon) on Sep 10, 2010 at 07:03 UTC
    Re: Bundling the Module Net::SFTP
    by Anonymous Monk on Sep 09, 2010 at 17:31 UTC
      Forgive me. I am really a newbie. I tried to follow Yes, even you can use CPAN .

      But I am getting this message.
      $ perl Makefile.PL PREFIX=/tmp/testme LIB=/tmp/testme Checking if your kit is complete... Looks good Writing Makefile for Net::SFTP Unable to open MakeMaker.tmp: Permission denied at /usr/lib/perl5/5.8. +0/ExtUtils/MakeMaker.pm line 997.
      Is the command that I issued correct?

        Maybe you don't have permission to write to /tmp/testme. Also, I think you're supposed to use different directories for LIB and PREFIX. Maybe consider taking a look at local::lib, which wraps all this in a convenient package.

    Re: Bundling the Module Net::SFTP
    by Utilitarian (Vicar) on Sep 10, 2010 at 10:43 UTC
      Perhaps you should be using PAR::Packer and distributing the resulting binary

      print "Good ",qw(night morning afternoon evening)[(localtime)[2]/6]," fellow monks."