If I understand you right, you're finding existing modules hard to understand how to use (rather than having problems writing your own).

It's true that few CPAN modules come with their own separate tutorials, but you can usually get clues from the include POD documentation. In most cases, the sample code in the SYNOPSIS portion actually works by itself, or would work inside a trivial program.

There are a few problems that I've seen with people using my CPAN modules. One is that they don't read the documentation in detail. A characteristic of much CPAN module documentation is that it doesn't repeat itself. The answer is probably in there, once, but you may have to look carefully. This is a different tack than most books take; it's typical in books to see the same information presented multiple times in different contexts. Not so in most CPAN modules. Another information source is example programs that might be included with the module. Also look at the test programs; these at least work.

To make your life easier with OO modules, also make sure you understand references and Perl's object model. As has been suggested, read and understand perlmod, perlmodlib, perltoot, and perlbot. Not that you have to understand these to use modules; it's just that you'll have an easier time with them if you do.


In reply to Re: Struggling with Modules by bikeNomad
in thread Struggling with Modules by c

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.