G'day koindrop,

The following is intended as a general guide for use with any module using either http://search.cpan.org/ or https://metacpan.org/.

The first thing to do is locate the MANIFEST file which should contain the paths to all files that make up the distribution.

Regardless of whether you're using search.cpan.org or metacpan.org, go to the documentation for the module and find (very near the top of the page):

link to author   link to distribution   Module::Name

[As an example, for the current version of CAM::PDF (at the time of writing), link to distribution looks like CAM-PDF-1.60.]

Follow the link to distribution which will take you to a page with a link to MANIFEST.

Follow the MANIFEST link to get a listing of all the paths that make up the module's distribution.

In your specific example (i.e. CAM::PDF), the documentation indicates examples can be found in the bin/ directory — which may be the case in many other modules. Also look in the t/ directory (which contains the *.t test files): these are inherently code usage examples. Many modules have specific examples/ (or similarly named) directories. Also, the code in subclasses of the target module (if such exist) will provide usage examples; as will any modules that have your target module as a dependency.

[Disclaimer: I've shown search.cpan.org ahead of metacpan.org throughout for consistency. While the former happens to be my preferred CPAN search engine (probably for no better reason than that's what I've been using for ~20 years) it doesn't need to be yours: use whichever you want.]

— Ken


In reply to Re: Where to find examples. by kcott
in thread Where to find examples. by koindrop

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.