Re: How do I get Pod::Simple to extract pod from its containing file?

[email protected] (Russ Allbery) Sat, 26 Jan 2013 18:44:16 -0800
Newsgroups perl.pod-people
Organization The Eyrie
Message-ID <[email protected]>
Karl Williamson <[email protected]> writes:
> On 01/26/2013 02:23 PM, Russ Allbery wrote:
>> Karl Williamson <[email protected]> writes:

>>> With Pod::Parser, you just do
>>> 	parse_from_file($in_fh, $out_fh)

>>> and it outputs the pod to $out_fh.  Pod::Simple has a method of the same
>>> name which is supposed to emulate the Pod::Parser method, but when I run
>>> it, nothing is output.

>> Did you flush $out_fh?  Pod::Parser did that but Pod::Simple doesn't, so
>> it's possible if you're doing something short that the entire output was
>> still buffered.

>> Pod::Man and Pod::Text use this Pod::Simple method and do have test suites
>> for it and it seems to work.

> See the attached program.  The resultant file is 0 length.

Oh!  I misunderstood, sorry.  parse_from_file() does indeed invoke the
parser with the appropriate actions, but what you meant was that
Pod::Parser's "null" parser, when not subclassed, just printed the POD
back out again, so you could use it as a way to extract the POD from a
file.  I believe Pod::Simple's "null" parser does nothing at all, so you
get an empty file.

Yes.  I think that's an incompatibility.

-- 
Russ Allbery ([email protected])             <http://www.eyrie.org/~eagle/>