--- Pod-HtmlEasy-0.0911/lib/Pod/HtmlEasy.pm 2007-12-26 05:42:36.000000000 +0900
+++ Pod-HtmlEasy-dev/lib/Pod/HtmlEasy.pm 2007-12-27 17:29:53.000000000 +0900
@@ -332,6 +332,8 @@
# Build the header to the HTML file
my @html;
+ my $title_line_ref;
+ if ( not exists $args{only_content} ) { # [31784]
push @html,
qq{<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">$NL};
push @html, qq{<html><head>$NL};
@@ -343,11 +345,10 @@
qq{<meta name="GENERATOR" content="Pod::HtmlEasy/$VERSION Pod::Parser/$Pod::Parser::VERSION Perl/$] [$^O]">$NL};
}
push @html, qq{<title>$title</title>$NL};
- my $title_line_ref = \$html[-1];
+ $title_line_ref = \$html[-1];
push @html, _organize_css( \%args );
push @html, qq{</head>$NL};
- if ( not exists $args{only_content} ) {
- push @html, _organize_body( \%args );
+ push @html, _organize_body( \%args );
}
delete $this->{UPARROW};
@@ -375,7 +376,9 @@
# If there's a head1 NAME, we've picked this up during processing
if ( defined $this->{TITLE} && length $this->{TITLE} > 0 ) {
- ${$title_line_ref} = qq{<title>$this->{TITLE}</title>$NL};
+ if (defined $title_line_ref) {
+ ${$title_line_ref} = qq{<title>$this->{TITLE}</title>$NL};
+ }
}
# Note conflict here: user can specify an index, and no_index; no_index wins
@@ -386,8 +389,9 @@
push @html, qq{<div class='pod'><div>$NL};
push @html, @{$output}; # The pod converted to HTML
push @html, q{</div>};
- if ( not defined $args{only_content} ){ push @html, q{</body>}; } # [31784]
- push @html, qq{</html>$NL};
+ if ( not exists $args{only_content} ) { # [31784]
+ push @html, qq{</body></html>$NL};
+ }
delete $this->{TIEDOUTPUT};
close $html or carp q{Could not close html};