You can be more specific in the command to CPAN, and tell it to install a specific version, if it still is on CPAN. For that, you have to prefix it with (at least) the initials of the author plus a slash, specify the distribution name, and don't forget to append ".tar.gz". (The latter is a mistake in the design of the CPAN API, IMO.)

For example:

perl -MCPAN -e install -e shift YVES/MIME-Lite-3.01_05.tar.gz
if you want to install a specific developer version from MIME::Lite.

Note that I passed the module name through @ARGV (with shift) because it's not a bareword. I find it a bit easier than quoting.

I also heard like we can take a snapshot of the CPAN modules installed in the server.

So is that I can copy the snapshot directly to the destination server.

Well, sort of... you can make a list of the currently installed modules using autobundle in the CPAN shell. The result is a Bundle "module", which, if you install it, will install the modules in it; so it's best to weed out all the stuff you don't need, or don't want to touch. (Last I tried, years ago, it tried to reinstall core modules.) I'm not sure it'll indeed try to match up the version. It might: the data is present.

If it doesn then you can still make a script out of the list of items you want, and then you can install them automatically, at least, for the time that version is still on CPAN.

If the architecture is identical, or if the modules don't depend on the architecture, you can indeed make a copy of the file trees for these modules. Better still is to use the directories that make builds when you test or install a module. That's basically what PPM does, too.

It must be possible to automate making a tarball that.


In reply to Re: perl modules replication by bart
in thread perl modules replication by palette

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.