Pod::Simple output as POD
[email protected] (James E Keenan) Tue, 12 Aug 2014 10:06:40 -0400
| Newsgroups | perl.pod-people |
|---|---|
| Message-ID | <[email protected]> |
I am writing concerning
https://rt.perl.org/Ticket/Display.html?id=116467. The objective of
this ticket is to revise t/porting/podcheck.t so that it no longer
depends on CPAN module Pod::Parser. The latter has been designated
"legacy code" but we cannot remove it from the core distribution until
podcheck.t no longer depends on it, either directly (calls to
parse_from_filehandle) or indirectly (via an older version of
Pod::Checker which depends on Pod::Parser rather than Pod::Simple).
While studying podcheck.t recently I noticed that we could get
substantially closer to our goal if we took the following subroutine
from podcheck.t:
#####
sub extract_pod { # Extracts just the pod from a file; returns undef
if file
# doesn't exist
my $filename = shift;
my @pod;
# Arrange for the output of Pod::Parser to be collected in an array
we can
# look at instead of being printed
tie *ALREADY_FH, 'Tie_Array_to_FH', \@pod;
if (open my $in_fh, '<:bytes', $filename) {
my $parser = Pod::Parser->new();
$parser->parse_from_filehandle($in_fh, *ALREADY_FH);
close $in_fh;
return join "", @pod
}
...
#####
... and could rewrite the 'if' block using a Pod::Simple-based call.
However, AFAICT there is nothing in the latest CPAN release of
Pod::Simple by which one could simple extract the POD from a file and
return it as a single string, POD-formatting intact and otherwise
unmodified.
Karl Williamson noted
(https://rt.perl.org/Ticket/Display.html?id=116467#txn-1304150) that
there have been some efforts in this direction, citing:
https://github.com/genehack/pod-simple/tree/add-pod-simple-pod. Could
you advise as to the current state of development of this fork and
whether it is likely to be of benefit to P5P in this instance?
Thank you very much.
Jim Keenan