This module allows you to write scripts which contain their own documentation internally using Pod markup.
The documentation can then be displayed to a user without having to write your own "print" statements, or duplication.
None. (Ships as part of Perl
Who Should Use It
Anybody who is writing complex command-line scripts which would benefit from included documentation, and who doesn't wish to describe the programs command line arguments more than once.
None that I could tell.
pod-usage - A simple program with its own documentation.
--help Show this scripts help information.
--manual Read this scripts manual.
--version Show the version number and exit.
Show the brief help information.
Read the manual, with examples.
Show the version number and exit.
The following is an example of this script:
This is a simple demonstration program for Pod::Usage, this text
will be displayed if the script is invoked with '--manual'.
$Id: pod-usage,v 1.79 2006/01/07 23:23:12 steve Exp $
# Release number.
my $RELEASE = '0.8';
# Parse command line arguments. These override the values from the
# configuration file.
# Do more stuff ..
# All done
Parse the arguments specified upon the command line.
my $HELP = 0; # Show help overview.
my $MANUAL = 0; # Show manual
my $VERSION = 0; # Show version number and exit.
# Parse options.
pod2usage(1) if $HELP;
pod2usage(-verbose => 2 ) if $MANUAL;
if ( $VERSION )
my $REVISION = '$Id: pod-usage,v 1.79 2006/01/07 23:23:12 ste
+ve Exp $';
$VERSION = join (' ', (split (' ', $REVISION)));
$VERSION =~ s/,v\b//;
$VERSION =~ s/(\S+)$/$1/;
print "pod-usage release $RELEASE - CVS: $VERSION\n";
Once I started using this module I found that it was incredible easy to start writing documentation for functions and little tutorials inside my code.
The fact that the '--manual' flag, (or whatever you like), can be made to display the Pod text from your script is very useful.
In reply to Pod::Usage
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:
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, 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, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
| & || & |
| < || < |
| > || > |
| [ || [ |
| ] || ] ||