Use the -opath option to write these to an alternative directory (e.g., if
you're doing all modules and don't want to untidy(!) a production
directory with a lot of temp files.)
``Any stuff you put in external pod files (.pod) should be tutorial like material
(extended documentation) ~ the api spec should be in with the module (.pm )'' -
http://www.perlmonks.org/
Note: The command line script podchecker uses Pod::Checker
qw(podchecker). Returns a 0 (zero) if Pod is found,and there are no syntax
errors. Or you can write your own script using Pod::Checker for more control:
use Pod::Checker;
my %options = ( -warnings => 2, );
my $pc_rc = podchecker( $ARGV[0], undef, %options );
printf "File $ARGV[0] has %s\n",
( $pc_rc =~ /^0$/ )?'good Pod':'Problems';
use Pod::Simple::Checker;
my $parser = Pod::Simple::Checker->new();
$parser->parse_file($ARGV[0]);
printf "File $ARGV[0] has %s\n",
(defined $parser->content_seen)?'Pod.':'NO Pod';
Might catch different errors vs. Pod::Checker. Basically the same purpose.
See comment at Suggested codemod.
Only works on modules (requires a name like Your:Module).
Difference from Pod::Checker: Take CGI::Apache (deprecated). It Checks out ok
(RC = 0) but rates ``No Coverage'' here because there are no subroutines
(therefore no corresponding =items)
use Pod::Usage;
GetOptions(\%options, qw(help man warnings+ nowarnings)) || pod2usage(2);
Takes the existing embedded Pod in your application program and
formats/outputs it in response to command line options, e.g. -help or
-man.
Example, try :
podchecker -man
Man page was generated on the fly. You'll notice the physical file is
/tmp/somerandomstring (see last line: assuming your pager is less), and the
page title contains User contributed... (compare to display of `man
podchecker`).
pod2usage Anything_with_a_Pod_SYNOPSIS # command line executable.
Pod::Find qw(pod_find)
Finds text files with Pod ( *.pod | *.pm | *.pl ) according to supplied paths
/ options.
Is Pod expected in Perl Scripts?.
A search in a typical nix Perl installation found only 1 .pl lib entry,
namely perl5db.pl, contained (A lot of) Pod (plus a lot of regular
comments).
Pod is very useful in terms of the final product, i.e. accessable,
multi-linked-page documentation. But the syntax is cumbersome, especially when
creating inline Pod.
By comparison, javadoc is easier to use, having only the ``/**'' and @keywords.
Short of emulating that, perhaps a Pod-skeleton-builder is in order, which would
take source code and insert the minimum Pod structure that could be subsequently
filled in.
Need to flag pod which consists of nothing more than =cut.
More specifically, need to flag missing format-essential-blank-lines before
commands. It may be also beneficial to give a warning for the last command
in a =forcomment block (as in, Did you really want to do that?)
Also, it may be good to Warn for each =cut which has no commands preceding.
Pod::Simple::Checker appears to do this (although it also misses the fact that
the commands preceding may be invalid as they are not preceded by space.)