sub print_story {
my ($source,$html) = @_;
my $tab = $html ? 3 : 4;
start_html() if $html;
while (my $line = <$source>) {
chomp($line);
if ($line =~ m/^&/) {
# This is where the code would go to parse the subroutines
# within __DATA__. The subroutines to be parsed would be
# preceded with an &.
}
elsif ($line =~ m/^) {
line($tab,$line);
}
elsif ($line =~ /^[1-6]\s/) {
my ($heading,$text) = split(/ /,$line,2);
line($tab,qq(
$line
)); } } line($tab,qq( )) if $tab == 3; end_html if $html; }