Pod::Parser not recognising "interior sequences"

H

Henry Law

Can someone who has worked with Pod::parser 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::parser using PPM.

I'm writing a simple Pod parsing module. So far all it does is subclass
some of the methods from Pod::parser, 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::parser);

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>).
 
S

Sisyphus

..
..
I'm writing a simple Pod parsing module. So far all it does is subclass
some of the methods from Pod::parser, but the "interior_sequence"
subroutine doesn't ever seem to be called.

Looking at the Pod::parser source, 'textblock' calls 'interpolate', which
calls 'parse_text', which calls 'interior_sequence'. (At least, that appears
to be *one* pathway to the calling of 'interior_sequence'.)
But there's nothing in HTMLDoc.pm that's going to lead to
'interior_sequence' being called.

Cheers,
Rob
 
H

Henry Law

Sisyphus said:
Looking at the Pod::parser source, 'textblock' calls 'interpolate', which
calls 'parse_text', which calls 'interior_sequence'. (At least, that appears
to be *one* pathway to the calling of 'interior_sequence'.)
But there's nothing in HTMLDoc.pm that's going to lead to

There is now, and it works perfectly. Thank you for that. The answer,
of course, was staring me in the face but it often takes someone else to
point it out.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top