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

Oh wise monks, I have created a utility that I will want to take to a customers location and run from their servers. Many customers have a problem installing perl modules, mostly due to firewall constraints. What is the best way for me to package the modules I need so that they can be installed from media I bring with me? I'm especially interested in figuring out how to download all the dependencies, it occurs to me that cpanm must put them somewhere, but I'm not sure if they get left around anywhere. The modules I need are If I can package up all the tar files for these and their dependent modules I think I can figure out the install process from there, just not sure if this is the best way to address this issue, or how to go about finding all the dependencies. Thanks for sharing your wisdom!
"B-)>
  • Comment on Whats the best way to package cpan modules

Replies are listed 'Best First'.
Re: Whats the best way to package cpan modules
by superfrink (Curate) on Mar 31, 2014 at 22:22 UTC
      I installed and played with pp, but for some reason the "executable" created doesn't behave the same as the perl script. I would also like to ensure that I retain the platform independence of executing perl script. I will be using the scripts on various versions of Linux, Unix and OsX and possibly Winduohs.
      "B-)>
        You might be able use lib a relative path and put the installed modules with the program in a zip/tar file.

        I made some notes when I installed modules to a custom folder that might help you create the zip/tar.
        you'll have to build one for each platform ... perlport
Re: Whats the best way to package cpan modules
by mascip (Pilgrim) on Mar 31, 2014 at 22:55 UTC
    I've never used it myself, but Carton's bundle command might do what you want.
Re: Whats the best way to package cpan modules
by Anonymous Monk on Apr 01, 2014 at 13:18 UTC

    Well, the brute force way is to use CPAN::Mini to build your own CPAN mirror, and then run that to the media of your choice. When you get to the client site, insert it into a machine and point your CPAN client to it.

    This has the advantage that you do not need to build something architecture-specific. The disadvantage is that you bring along all of CPAN, but if you configure the minicpan client correctly this is "only" about 2.7 Gig.

    Of course, CPAN clients can be configured to deal with firewalls. See settings http_proxy and/or ftp_proxy, and the environment variable documentation in LWP. The ActivePerl installer can do this too, but it has been a long time since I did this and I do not now remember how.