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

Hi, I am working with perl in an automation project and I have installed number of modules (say 10),to my kowledge,to work with other boxes, I have to do the same manually in all boxes which is frustrating and time consuming. Is there any method such as imaging PERL with modules or some perl module itself to copy the perl set up from source box to target boxes..
  • Comment on Is it possible to image the perl from one box to another

Replies are listed 'Best First'.
Re: Is it possible to image the perl from one box to another
by almut (Canon) on Jul 29, 2010 at 13:33 UTC

    If the machines are binary-compatible and are running the same OS with the same set of libraries installed, it may be sufficient to just create a tarball (or zipfile) of the entire Perl installation, and unpack it on the target machines (on Unix you generally have to unpack it into the same directory that it was installed originally, because the installation path in hard-coded in the perl binary).

    If you have modules that depend on 3rd-party shared libraries installed in other locations (e.g. database libs), you have to transfer them as well.

    Update: useful tools for investigating shared library dependencies: ldd on Linux/Unix, Dependency Walker on Windows.

      btw, for strawberry perl, even same paths in not a requirement, there's relocation.pl in the strawberry root directory which does the trick.
Re: Is it possible to image the perl from one box to another
by Corion (Patriarch) on Jul 29, 2010 at 13:36 UTC

    I think the common approach is to package each module using your distribution package manager and to install the modules using your OS package manager across all machines.

    If you do not have a central package repository for your organization or do not want to use your Perl installation with the OS package manager, then copying the Perl installation will work as long as your machines are all identical with regards to library versions and kernel versions.

Re: Is it possible to image the perl from one box to another
by Anonymous Monk on Jul 29, 2010 at 15:18 UTC

    I had came across this link when doing a similar research myself. Though have to admit haven't got a chance to try any of this myself.
    http://www.ibm.com/developerworks/linux/library/l-depperl.html?S_TACT=105AGY82&S_CMP=MAVE
    Hope this helps as reading material if nothing more than that.
    Best Regards.

    p.s: Please don't shoot me if this link has misleading or provides out of date material. If that is the case I would like to know about it myself since for now I am looking at the information at above link as useful and worth a try.

    p.p.s: I had read at perlmonks about "not posting a solution if we are not absolutely sure about it or haven't tried it our self". Of-course I understand that this is for the benefit of the newbies like me so we do not get started on a wrong path.

Re: Is it possible to image the perl from one box to another
by cutlass2006 (Pilgrim) on Jul 29, 2010 at 19:18 UTC

    it depends ... to a certain degree what you want to do is configuration management and app deployment. It will be up to you to decide if what you are doing is just simple maintenance scripting or maybe its time to formalize your approach.

    A build.pl (Module::Build) would give you app deployment and manage the deps, but you may combine using some Configuration Management (CM) ... I have used puppet with great success and would highly recommend investigating using it ... you can easily control every aspect of a machine ... I use debian packages for most of the perl stuff these days, but it also has cpan integration and *everything else*.