Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: RFC: Pod::Remove

by IlyaM (Parson)
on Mar 13, 2003 at 11:34 UTC ( #242654=note: print w/replies, xml ) Need Help??


in reply to RFC: Pod::Remove

Pod::Stripper is based on Pod::Parser, which works mainly on input- and output-streams, i.e. files or filehandles. Which makes it really hard to capture the result in a string.

In Perl >= 5.8.0 it is not a problem:

# opens filehandle to "in memory" files held in Perl scalars open($fh,'>', \$variable);

In Perl < 5.8.0 you can use IO::Scalar to do the same thing.

Another comment: why not patch existing module to do what you want instead of creating yet another CPAN module?

--
Ilya Martynov, ilya@iponweb.net
CTO IPonWEB (UK) Ltd
Quality Perl Programming and Unix Support UK managed @ offshore prices - http://www.iponweb.net
Personal website - http://martynov.org

Replies are listed 'Best First'.
Re: Re: RFC: Pod::Remove
by domm (Chaplain) on Mar 13, 2003 at 12:06 UTC
    Firstly, thanks for the feedback.

    Secondly: I'm (still) using 5.6.1 and did't know of the feature you mentioned. Using IO::Scalar might also be feasable.

    Another comment: why not patch existing module to do what you want instead of creating yet another CPAN module?

    Pod::Parser seems rather complex, so I thought patching it to return a scalar instead of writing to a FILEHANDLE would be hard. Passing an IO::Scalar-FH (or adding some methods to Pod::Parser that implement this) might be a good idea.

    On the other hand, Pod::Parser seems like a little bit of overkill, if all I want to do is remove POD.

    I'll give it a thought, and talk to Marek Rouchal about patching Pod::Parser.

    UPDATE

    Marek suggested using Pod::Simple, as "therein lies the future" (his words). So I'll take a look there...

    -- #!/usr/bin/perl for(ref bless{},just'another'perl'hacker){s-:+-$"-g&&print$_.$/}

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://242654]
help
Chatterbox?
[haukex]: Corion: I once wrote an automated thingy for that here
[haukex]: here's the code that uses it
[Corion]: haukex: Hmm - maybe I can reuse that. I see that it uses Pod::Parser, which I think was one of the more fragile parsers. But if I'm statically (re)generating the tests instead of doing that "live" on the client/tester machines, that's a much smaller...
[Corion]: ... problem space than trying to cater to all versions of Pod::Parser(s)
[haukex]: I think you're right, I think Pod::Simple is the preferred parser now
[haukex]: But I was just using it as an author test anyway
[Corion]: haukex: Aaah - I thought you were still running these tests on every machine, but you only run these as author or Devel::Cover tests
[Corion]: haukex: Yeah, I think back then I used Test::Inline, which used a pod parser that was going through some changes and I didn't want to cater for all the various versions and thus stopped testing the Pod completely
[choroba]: I usually do this with presentations
[Corion]: But now I think statically (re)generating the Pod tests is a saner approach, and likely I'll regenerate the tests either in Makefile.PL or from xt/ but have them live below t/

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (10)
As of 2017-02-27 12:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (385 votes). Check out past polls.