So.. I was trying out Pod::POM ...
#!/usr/bin/perl use base 'LEOCHARRE::CLI'; use strict; use Pod::POM; use Cwd; my $o = gopts(); #my $files = argv_aspaths(); my @sections = qw(name synopsis description subroutines methods author + bugs license); #for my $abs (@$files){ my $abs = Cwd::abs_path($ARGV[0]); my $parser = new Pod::POM; print STDERR "File $abs.\n"; my $pom = $parser->parse($abs) or die; my %section; for my $h ( $pom->head1 ) { my $name = $h->title; my $cont = $h->content; $section{ $name } = $cont; debug("found section $name"); } for (@sections){ my $section = uc($_); my $have = exists $section{$section} ? 1 : 0; print STDERR "Section '$section' is present? $have\n"; unless($have){ #push @{$pom}, # ?????? } } print STDERR "\n"; # view print $pom->present;

It takes a path to a file with pod, shows some little things.. And prints the output as parsed by Pod::POM, (could be slightly modified).

I was wondering.. How would I got about inserting a pod section?

My goal is to have some scripting that checks my modules and find out what parts are missing, etc, and inserts them for me. I have some code that will analize a module and create the pod, but in this case, I have pre-existing pod that I would like to check, maybe alter and spit to stdout..

Is there some other Pod:: module I should be taking a better look at? Tons on cpan, dizzying..


In reply to check pod and insert missing sections by leocharre

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.