Practically every production-ready Perl script or module has the POD embedded within the source code itself. There are various strategies for doing this; embed it intermixed with code, or embed it after the end of the code. There are arguments for doing it either way, so rather than to hijack the thread toward that topic I'll move on to why I replied. I only mention it here so you'll know ahead of time what to look for.

Since POD is embedded in almost every piece of Perl code that ships with the Perl distribution, you have hundreds of examples to choose from. Literally view the contents of a Perl script or module that shipped with Perl. When you finish that one, look at another. ;)

Then if you want more help, install Module::Starter, create a temporary folder, enter that folder, and type module-starter --module=Mytest --author='your name' --email=your@email. A little module stub will be created in your temp directory, and if you view the source of Mytest.pm you will find a POD template embedded in it. It's pretty basic, but you can use it as a starting point. In fact, I don't do this myself, but it would be pretty easy to put at the top of it your boilerplate "use strict; use warnings;" stuff, push the embedded POD to the bottom, remove anything module-specific, and use it as a template for any script you write.


Dave


In reply to Re: POD: For Beginners by davido
in thread POD: For Beginners by perl.j

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.