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 Aug 15, 2021
1 parent 3729ad8 commit ea39692
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 @@ -273,7 +273,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 @@ -282,14 +281,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 @@ -631,7 +630,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 @@ -641,7 +640,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 ea39692

Please sign in to comment.