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

Hello,
i am developing a Perl program that i would like to be able to run on several Virtual Machines (with VirtualBox).
I want to run exactly the same program on all machines.

Question about Perl installation :
- Do i have to install Perl on each of the virtual machines?
- Or can i just install it once on the host machine, and then use it on all the virtual machines ?
- Would i have to install Perl in a shared folder?

And about my program :
- Will i have to copy it to every virtual machine every time i change it ? - Or is there any hope to have it in only one place (a shared folder) and run it from each machine?

Last question: I don't need to run it at the same time on several machines, but am wondering if it would be possible.

Thank you :o)

Replies are listed 'Best First'.
Re: VirtualBox and Perl installation(s)
by GrandFather (Saint) on Feb 20, 2012 at 21:15 UTC

    In every place you put "virtual machine" in your question above put "computer" and for "host machine" substitute "server". Now answer the questions yourself. The point of "virtual machines" is that for most purposes they are indistinguishable from "real machines".

    The more interesting problem is code management. Should you keep a single copy in a common place or have a copy on each machine and a system for deploying changes? That is not something we can answer without knowing more about what you are doing. Whatever you do I'd strongly advise you to use Mercurial or git to revision control your code.

    True laziness is hard work
Re: VirtualBox and Perl installation(s)
by BrowserUk (Patriarch) on Feb 20, 2012 at 21:50 UTC

    If you use linked clones, you'll only need to maintain one image and the others will be updated automatically. You'll also save yourself a crap load of disk space.


    With the rise and rise of 'Social' network sites: 'Computers are making people easier to use everyday'
    Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
    "Science is about questioning the status quo. Questioning authority".
    In the absence of evidence, opinion is indistinguishable from prejudice.

    The start of some sanity?

Re: VirtualBox and Perl installation(s)
by salva (Canon) on Feb 20, 2012 at 23:13 UTC
    You can use NFS or Samba to mount some shared directory on all the virtual machines.

    VirtualBox also has its own support for shared drives, but in that case, you will need to run all the virtual machines in the same host.

      Thank you for precious answers, the server-computer analogy made it all more clear :o) Still not perfectly clear, but a lot more.

      1. Perl
      I am thinking of using linked clones for the OS (Windows XP) and softwares, and maybe Perl's installation (i'm still not clear about this, i don't know why).

      2. CPAN modules
      For the modules, I read this article, which seems to answer my question.
      If i understood well (all this is quite new to me), by using the scripts presented there, i would

      - Download and install CPAN modules normally on my host computer

      - Script "Listing 4" would read the list of my CPAN modules and download them to my shared folder

      - Script "Listing 5" would build all of these modules to make them "ready-to-install"

      - Script "Listing 6" would install them on a computer (repeat this operation for each computer).

      This method is quite old (2004), is there any better way now? perlbrew?? I really don't know much about it, is it worth looking into, for my needs ?

      3. Source code
      Is it possible to have my source code only in one place ?
      Could i then run scripts with WWW::Mechanize::Firefox from each of the computers?
      Otherwize i guess revision control will be my solution.

      PS : As i run all my guests on the same host, i think i can use VirtualBox's shared folder for the CPAN installation trick... and for my source code ??