The standard procedure for installing all CPAN modules is basically the same:

  1. Copy the tar/gzip archive to your local machine;
  2. Unpack the tar/gzipped file contents;
  3. Go to the top level of the unpacked directory;
  4. Run the command perl Makefile.PL;
  5. Run the command make;
  6. Run the command make test;
  7. Run the command make install.

You may find some (mostly older) modules that have slightly different build procedures. If so, those will be documented in one of the unpacked files, usually with a name like README.

If there's a dependency, you'll usually be told in step (3), but sometimes not until step (4). For any required dependencies, you just follow the same procedures. That can, of course, lead to more dependencies. If any step fails, you typically do not want to proceed until you figure out why and fix it. I have found cases where some tests during the make test phase fail where it was okay for me to continue on after doing some analysis.

I pick a fixed root directory for all my downloaded CPAN unpacked archives (e.g., /usr/local/src/cpan). That way I can automate some of it and have a quick look at what I've downloaded and (probably) installed.

Normally, you will not break anything by installing new modules that don't already exist. If the make process tells you you need a newer version, then you may hit issues. In practice, I've only had one issue like that I can recall in 5+ years of downloading and installing CPAN modules. If you want to be really paranoid, you can create an entirely different code path and access it by modifying Perl's @INC path list.

The caveat: I'm not a MAC user so I may be missing some some system dependency there.

There are also packages that help automate the whole process, including finding, downloading, and installing dependencies. I'll let someone more familiar with those explain them.


In reply to Re: How to install Date::Calc on a Mac by steves
in thread How to install Date::Calc on a Mac by cpiety

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.