koindrop has asked for the wisdom of the Perl Monks concerning the following question:

Simple question here. I am trying to write a program using the CAM::PDF module and this is the first time I've come across a task that I needed a module that I can't find outside documentation on, such as tutorials or books with examples. I'm a total amature when it comes to perl and linux, but I noticed on the cpan webpage for the module, that it says there are a lot of examples in the bin sub directory, however I can't find these examples. So, my question is simply what is the path to the bin sub directory. I am running Slackware 14.1 if that matters. Thanks in advance.

Replies are listed 'Best First'.
Re: Where to find examples.
by vinoth.ree (Monsignor) on Jun 08, 2016 at 02:51 UTC
Re: Where to find examples for CAM::PDF
by Anonymous Monk on Jun 08, 2016 at 01:58 UTC

      Thank you very much.

Re: Where to find examples.
by kcott (Archbishop) on Jun 09, 2016 at 07:49 UTC

    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.

    • For search.cpan.org, this is in the Special Files section near the top of the page.
    • For metacpan.org, this is in the Other files section near the bottom of the page.

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

    • For search.cpan.org, each path is itself a link.
    • For metacpan.org, the paths are just text: replacing MANIFEST, in the currect URL, with the textual path, creates the required link.

    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