if ($toc_string) {
$html_print->("<hr />\n") if $rOpts->{'frames'};
$html_print->("<h2>Code Index:</h2>\n");
- ##my @toc = map { $_ .= "\n" } split /\n/, $toc_string;
- my @toc_st = map { $_ . "\n" } split /\n/, $toc_string;
+ my @toc_st = split /^/, $toc_string;
$html_print->(@toc_st);
}
$in_toc = EMPTY_STRING;
if ($toc_string) {
$html_print->("<hr />\n") if $rOpts->{'frames'};
$html_print->("<h2>Code Index:</h2>\n");
- ##my @toc = map { $_ .= "\n" } split /\n/, $toc_string;
- my @toc_st = map { $_ . "\n" } split /\n/, $toc_string;
+ my @toc_st = split /^/, $toc_string;
$html_print->(@toc_st);
}
$in_toc = EMPTY_STRING;
if ( $html_fh->can('close') );
if ( $rOpts->{'frames'} ) {
- ##my @toc = map { $_ .= "\n" } split /\n/, ${$rtoc_string};
- my @toc = map { $_ . "\n" } split /\n/, ${$rtoc_string};
+ my @toc = split /^/, ${$rtoc_string};
$self->make_frame( \@toc );
}
return;
# Convert a scalar to an array.
# This avoids looking for "\n" on each call to getline
- #
- # NOTES: The -1 count is needed to avoid loss of trailing blank lines
- # (which might be important in a DATA section).
my @array;
if ( $rscalar && ${$rscalar} ) {
-
- #@array = map { $_ .= "\n" } split /\n/, ${$rscalar}, -1;
- @array = map { $_ . "\n" } split /\n/, ${$rscalar}, -1;
-
- # remove possible extra blank line introduced with split
- if ( @array && $array[-1] eq "\n" ) { pop @array }
+ @array = split /^/, ${$rscalar};
}
my $i_next = 0;
return bless [ \@array, $mode, $i_next ], $package;