AW: Pod::Simple can treat binary as pod due to liberal/inconsistent regexp patterns

[email protected] ("Marek Rouchal") Fri, 09 Jan 2015 07:38:26 +0100
Newsgroups perl.pod-people
Message-ID <[email protected]>
Right. Now I remember old threads where people would argue that POD parsers should do exactly the same as the Perl parser - and IIRC the conclusion was that using something like PPI to handle "pathological" cases like multiline strings or here docs would be an overkill, so POD is what starts with a (valid) POD directive. The only thing that perhaps could be changed is to skip a __DATA__ section (but keep parsing since there may be POD behind __END__ !)

I see a potential way of resolving this, but it looks like quite a big effort: the Perl parser could store all text it skips as POD in a similar structure like __DATA__ so that POD parsing utilities could use a pseudo-filehandle like this (reading POD for the current script):

while (<main::__POD__>) {
...
}

and for other files there could be a special open() discipline to return only POD using the same parser. What do you think?

-Marek


Von meinem Samsung Galaxy Smartphone gesendet.


-------- Ursprüngliche Nachricht --------
Von: Randy Stauner <[email protected]> 
Datum:08.01.2015  19:26  (GMT+01:00) 
An: "David E. Wheeler" <[email protected]> 
Cc: Marek Rouchal <[email protected]>, Karl Williamson <[email protected]>, [email protected] 
Betreff: Re: Pod::Simple can treat binary as pod due to liberal/inconsistent regexp patterns