H
Henry Law
Can someone who has worked with Pod:arser help me work out what I'm
doing wrong? Googling for "interior_sequence" turned up nothing of
interest. OS is Windows XP, running ActiveState Perl. I've installed
the latest version of Pod:arser using PPM.
I'm writing a simple Pod parsing module. So far all it does is subclass
some of the methods from Pod:arser, but the "interior_sequence"
subroutine doesn't ever seem to be called. I'm posting (a) the module
(stripped down); (b) a tiny Pod document for testing; (c) the driver
program; and (d) the incorrect output.
Stripped-down module "PodD::HTMLDoc"
===================================
package PodD::HTMLDoc;
use 5.008;
use strict;
use warnings;
use base qw(Pod:arser);
sub command {
my ($parser, $command, $paragraph, $line_num) = @_;
print "command: \$command=$command, \$line_num=$line_num\n";
}
sub verbatim {
my ($parser, $paragraph, $line_num) = @_;
print "verbatim: \$paragraph=$paragraph, \$line_num=$line_num\n";
}
sub textblock {
my ($parser, $paragraph, $line_num) = @_;
print "textblock: \$paragraph=$paragraph, \$line_num=$line_num\n";
}
sub interior_sequence {
my ($parser, $seq_command, $seq_argument) = @_;
print "interior_sequence: \$seq_command=$seq_command,
\$seq_argument=$seq_argument\n";
}
1;
Tiny Pod document
=================
=pod
Some text I<italic> more text
=cut
The driver program
==================
#! /usr/bin/perl
use strict; use warnings;
use PodD::HTMLDoc;
my $podfile = shift;
die "'$podfile' not found\n" unless (-f $podfile);
my $parser = new PodD::HTMLDoc();
$parser->parse_from_file($podfile);
The output
==========
command: $command=pod, $line_num=2
textblock: $paragraph=Some text I<italic> more text
, $line_num=4
.... no conversion of the interior sequence (which is I<italic>).
doing wrong? Googling for "interior_sequence" turned up nothing of
interest. OS is Windows XP, running ActiveState Perl. I've installed
the latest version of Pod:arser using PPM.
I'm writing a simple Pod parsing module. So far all it does is subclass
some of the methods from Pod:arser, but the "interior_sequence"
subroutine doesn't ever seem to be called. I'm posting (a) the module
(stripped down); (b) a tiny Pod document for testing; (c) the driver
program; and (d) the incorrect output.
Stripped-down module "PodD::HTMLDoc"
===================================
package PodD::HTMLDoc;
use 5.008;
use strict;
use warnings;
use base qw(Pod:arser);
sub command {
my ($parser, $command, $paragraph, $line_num) = @_;
print "command: \$command=$command, \$line_num=$line_num\n";
}
sub verbatim {
my ($parser, $paragraph, $line_num) = @_;
print "verbatim: \$paragraph=$paragraph, \$line_num=$line_num\n";
}
sub textblock {
my ($parser, $paragraph, $line_num) = @_;
print "textblock: \$paragraph=$paragraph, \$line_num=$line_num\n";
}
sub interior_sequence {
my ($parser, $seq_command, $seq_argument) = @_;
print "interior_sequence: \$seq_command=$seq_command,
\$seq_argument=$seq_argument\n";
}
1;
Tiny Pod document
=================
=pod
Some text I<italic> more text
=cut
The driver program
==================
#! /usr/bin/perl
use strict; use warnings;
use PodD::HTMLDoc;
my $podfile = shift;
die "'$podfile' not found\n" unless (-f $podfile);
my $parser = new PodD::HTMLDoc();
$parser->parse_from_file($podfile);
The output
==========
command: $command=pod, $line_num=2
textblock: $paragraph=Some text I<italic> more text
, $line_num=4
.... no conversion of the interior sequence (which is I<italic>).