NAME
Pod::MinimumVersion - Perl version for POD directives used
SYNPOSIS
use Pod::MinimumVersion;
my $pmv = Pod::MinimumVersion->new (filename => '/some/foo.pl');
print $pmv->minimum_version,"\n";
print $pmv->reports;
DESCRIPTION
Caution: This is work in progress, don't use it yet.
Pod::MinimumVersion
parses the POD in a Perl script, module, or document, and reports what version of Perl is required to process the directives in it with pod2man
etc.
CHECKS
The following POD features are identified.
L<display text|target> display part, new in 5.005.
C<< foo >> double-angles, new in 5.6.0.
=head3
and=head4
, new in 5.8.0.L<http://some.where.com>, new in 5.8.0. (Prior versions take the "/" as a "section" part, giving very poor output.)
E<apos>, E<sol>, E<verbar> chars, new in 5.8.0. (Documented in 5.6.0, but pod2man doesn't recognise them until 5.8.)
=encoding
command, new in 5.10.0. (Documented in 5.8.0, but pod2man doesn't recognise it until 5.10.)
FUNCTIONS
$pmv = Pod::MinimumVersion->new (key => value, ...)
-
Create and return a new
Pod::MinimumVersion
object which will analyze a document. The document is supplied as one offilehandle => $fh, string => 'something', filename => '/my/dir/foo.pod',
For
filehandle
andstring
, afilename
can be supplied too to give a name in the reports. The handle or string is what's actually read though.The
above_version
option lets you set a Perl version you use, so reports are only about features above that level.above_version => '5.006',
$version = $pmv->minimum_version ()
$report = $pmv->minimum_report ()
-
Return the minimum Perl required for the document in
$pmv
.minimum_version
returns aversion
object (see version).minimum_report
returns aPod::MinimumVersion::Report
object described below ("REPORT OBJECTS"). @reports = $pmv->reports ()
-
Return a list of
Pod::MinimumVersion::Report
objects concerning the document in$pmv
.These multiple reports let you identify multiple places that a particular Perl is required. With the
above_version
option the reports are still only about things higher than that.The report from
minimum_version
andminimum_report
is simply the highest Perl among these multiple reports.
REPORT OBJECTS
A Pod::MinimumVersion::Report
object holds a location within a document and a reason that a particular Perl is needed at that point. The hash fields are
filename string
linenum integer, with 1 for the first line
version version object
why string
$str = $report->as_string
-
Return a formatted string for the report. Currently this is in GNU file:line style, simply
<filename>:<linenum>: <version> due to <why>
SEE ALSO
version, Perl::MinimumVersion, Perl::Critic::Policy::Compatibility::PodMinimumVersion
HOME PAGE
http://user42.tuxfamily.org/perl-critic-pulp/index.html
COPYRIGHT
Copyright 2009 Kevin Ryde
Perl-Critic-Pulp is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
Perl-Critic-Pulp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Perl-Critic-Pulp. If not, see <http://www.gnu.org/licenses/>.