Skip to content

Commit

Permalink
Move $output into the object
Browse files Browse the repository at this point in the history
Correct dropped variable declaration.

Signed-off-by: James E Keenan <jkeenan@cpan.org>
  • Loading branch information
jkeenan committed May 12, 2021
1 parent 25ea7ee commit 2d9c09e
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions ext/Pod-Html/lib/Pod/Html.pm
Expand Up @@ -251,7 +251,6 @@ sub pod2html {

# set options for the HTML generator
my $parser = Pod::Simple::XHTML::LocalPodLinks->new();
my $output;
$parser->codes_in_verbatim(0);
$parser->anchor_items(1); # the old Pod::Html always did
$parser->backlink($self->{Backlink}); # linkify =head1 directives
Expand All @@ -260,14 +259,14 @@ sub pod2html {
$parser->htmlfileurl($self->{Htmlfileurl});
$parser->htmlroot($self->{Htmlroot});
$parser->index($self->{Doindex});
$parser->output_string(\$output); # written to file later
$parser->output_string(\$self->{output}); # written to file later
$parser->pages(\%Pages);
$parser->quiet($self->{Quiet});
$parser->verbose($self->{Verbose});

$parser = $self->refine_parser($parser);
$self->feed_tree_to_parser($parser, $podtree);
$self->write_file($output);
$self->write_file();
}

sub init_globals {
Expand Down Expand Up @@ -609,7 +608,7 @@ sub feed_tree_to_parser {
}
sub write_file {
my ($self, $output) = @_;
my $self = shift;
$self->{Htmlfile} = "-" unless $self->{Htmlfile}; # stdout
my $FHOUT;
if($self->{Htmlfile} and $self->{Htmlfile} ne '-') {
Expand All @@ -619,7 +618,7 @@ sub write_file {
open $FHOUT, ">-";
}
binmode $FHOUT, ":utf8";
print $FHOUT $output;
print $FHOUT $self->{output};
close $FHOUT or die "Failed to close $self->{Htmlfile}: $!";
chmod 0644, $self->{Htmlfile} unless $self->{Htmlfile} eq '-';
}
Expand Down

0 comments on commit 2d9c09e

Please sign in to comment.