Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Pod-Simple CPAN distribution.

Report information
The Basics
Id: 65428
Status: resolved
Priority: 0/
Queue: Pod-Simple

People
Owner: Nobody in particular
Requestors: avar [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 3.14
Fixed in: 3.16



Subject: ->parse_from_file does not work as advertised with ->output_string(\my $html)
The example here: http://search.cpan.org/~dwheeler/Pod-Simple- 3.15/lib/Pod/Simple/HTML.pm#Minimal_code Doesn't work. $p->parse_from_file($file) will *not* parse into the $html variable, but simply emit the HTML to standard out. What does work is: cat $(perldoc -l strict) | perl -MPod::Simple::HTML -wle 'my $html; my $p = Pod::Simple::HTML->new; $p->output_string(\$html); $p- Show quoted text
>parse_string_document(join "", <>); print $html'
I.e. using ->parse_string_document() instead of ->parse_file(). Pod::Simple::XHTML has the same bug.
Subject: Re: [rt.cpan.org #65428] ->parse_from_file does not work as advertised with ->output_string(\my $html)
Date: Sat, 5 Feb 2011 17:03:34 -0800
To: bug-Pod-Simple [...] rt.cpan.org
From: "David E. Wheeler" <dwheeler [...] cpan.org>
On Feb 3, 2011, at 12:13 PM, AEvar Arnfjord Bjarmason via RT wrote: Does this work for you? use Pod::Simple::HTML; my $p = Pod::Simple::HTML->new; $p->output_string(\my $html); $p->parse_from_file(shift); print $html; I just tried it (with XHTML, too), and it seems fine. Best, David
On Sat Feb 05 20:03:44 2011, DWHEELER wrote: Show quoted text
> use Pod::Simple::HTML; > my $p = Pod::Simple::HTML->new; > $p->output_string(\my $html); > $p->parse_from_file(shift); > print $html; > > I just tried it (with XHTML, too), and it seems fine.
Bah! It's not fine. Sorry, will fix. David
On Mon Feb 21 19:53:05 2011, DWHEELER wrote: Show quoted text
> On Sat Feb 05 20:03:44 2011, DWHEELER wrote: >
> > use Pod::Simple::HTML; > > my $p = Pod::Simple::HTML->new; > > $p->output_string(\my $html); > > $p->parse_from_file(shift); > > print $html; > > > > I just tried it (with XHTML, too), and it seems fine.
> > Bah! It's not fine. Sorry, will fix.
Okay, the parse_from_file() is the wrong method. Use parse_file() instead. I've added some tests for that method, and fixed the Pod::Simple::HTML docs, here: https://github.com/theory/pod- simple/commit/d2ede567b878285c9f0c6657783b52906a02db25 Thanks!