Installing Perl modules is easy, especially if you've got root access.

CPAN modules follow a simple build protocol:

tar zxvf Module.tar.gz
cd Module
perl Makefile.PL
make
make test
make install

if you prefer not working as root (and no one sensible does!), I highly recommend installing sudo, which will let execute single commands as root.

Following this way of doing it has the additional benefit of making sure that you have all the modules you need to use the one you're installing - you'll get a warning from the perl Makefile.PL about it.

As was mentioned, though, using CPAN.pm makes it much simpler; CPAN.pm will automagically grab anything else you need as a prerequisite and install it too. Once you've gone through the process of initializing CPAN.pm once (I recommend using the http: CPAN mirrors, by the way, as they tend to be faster to access), you can do things like this:

sudo perl -MCPAN -e'install Some::Module'

and have CPAN.pm sort it all out for you.


In reply to Re: Newbie Adding Module to Perl by pemungkah
in thread Newbie Adding Module to Perl by from_laura

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.