Argument parsing and checking also serves as the documentation.
Don't get me wrong, your pointer to the tutorial is excellent.

I was just hoping that actually specifying the option spec would create the pod, or vice-versa. I prefer to define everything once and only once. This includes the strings used in the options spec, which are also used in the usage, and in the documentation (if I can wedge them in everywhere) -- I usually put those in variables, and reuse them or derive other stuff from them. I use string variables and use strict vars so that if I misspell something, it's a variable name, and it's caught by Perl, instead of my curmudgeonly user.

I also realize that I can't have everything. (If it was easy, someone else would have a solution in the core already :) So I should spend some time and see if I can make pod work the same way as G:D.

I'm also lazy in that I'm trying to combine usage and documentation. I should probably cut back on the usage, and split out the documentation. If I put the full docs into a sub, one of the options can call it. (Or I can go the pod2usage route...though in some sense that's got the same trouble in reverse.)

-QM
--
Quantum Mechanics: The dreams stuff is made of


In reply to Re^3: Getopt::Declare replacement? by QM
in thread Getopt::Declare replacement? by QM

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.