#!/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
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |