Pod::Tidy is a reformatting Pod processor.
SYNOPSIS
use Pod::Tidy qw( tidy_files tidy_filehandle );
my $processed = Pod::Tidy::tidy_files(
files => @list,
ignore => [qr/foo/, qr/bar/],
recursive => $recursive,
verbose => $verbose,
inplace => $inplace,
nobackup => $nobackup,
);
Pod::Tidy::tidy_filehandle($input);
This module provides the heavy lifting needed by the podtidy utility although the API should be general enough that it can be used directly.
USAGE
Import Parameters
This module accepts no arguments to it's import method and exports no symbols.
Exportable Subroutines
tidy_files( ... )
Accepts a mandatory hash.
my $processed = Pod::Tidy::tidy_files(
files => @list,
ignore => [qr/foo/, qr/bar/],
recursive => $recursive,
verbose => $verbose,
inplace => $inplace,
nobackup => $nobackup,
);
files
An array ref to a list of files and/or directories.
ignore
An array ref to regex objects that are used to reject files and/or directories. Each pattern is tried for a match against (in order) the absolute file path, the relative file path (canonical), and the basename. In the case of directories, the "basename" is considered to be the right most path component. For example, the "basename" of /foo/bar/baz/ would be to be baz.
This key is optional.
recursive
Accepts undef, 0, or 1. If set to 1 any directories provided to the files key will be recursively expanded. Defaults to undef
This key is optional.
verbose
Accepts undef, 0, or 1. 1 enables verbose warnings. Defaults to undef.
This key is optional.
inplace
Accepts undef, 0, or 1. 1 enables in place reformatting of files. Updated files will be backed up unless the nobackup key is set. The mtime of the file is guarenteed not to be changed unless formating changes did occur. Defaults to undef.
This key is optional.
nobackup
Accepts undef, 0, or 1. If set to 1 files being reformatted in place will not be backed up. Defaults to undef.
This key is optional.
Before processing a file it is checked for:
correct access permissions
containing Pod
legal Pod syntax
Any file failing to meet those criteria will not be processed.
Returns a count of processed files or undef if no files could be processed.
tidy_filehandle($input)
Accepts an open filehandle. Data from the filehandle is processed as it is read so this subroutine can be used to filter large amounts of data. Because of this behavior the input can not be checked in advance to verify a) That it's actually Pod and b) that the Pod document uses only valid Pod syntax. Output is set to STDOUT. Returns nothing.
Product's homepage
Requirements:
· Perl