On Fri, Jul 07, 2000, Michael A. Chase wrote:
> Perhaps you could give us an example of the text you are trying to parse
> that includes a comment that gets passed to the 'comment' event handler, but
> doesn't get passed to the 'default' event handler when the 'comment' handler
> isn't defined.

Sorry, I realized that I sent my example without enough details but you
replied before I could submit an example.

> A short example script that shows the problem would also be handy.  I'd be
> especially interested in seeing all HTML::Parser method calls..

I was running a test on an excerpt of an HTML file (this is not valid
HTML by itself, but I did that to isolate the problem):

        <!-- test
        --> <a href="fdasfafdas"></a>

Here's a sample script:

        use strict;
        require HTML::Parser;
        my $p = HTML::Parser->new;
        $p->handler(@EVENT@ => \&text, 'text');
        $p->parse_file('/tmp/foo.html');

        sub text() {
          my ($t) = @_;
          print $t . "\n";
        }

With @EVENT@ being 'comment':

        [hugo:pts/2] larve:~> perl -w test.pl 
        <!-- test
        -->
        [hugo:pts/2] larve:~> 

With @EVENT@ being 'default':

        [hugo:pts/2] larve:~> perl -w test.pl 
        [hugo:pts/2] larve:~> 

-- 
Hugo Haas, Webmaster, Systems Team - W3C/MIT
mailto:[EMAIL PROTECTED] - tel:+1-617-452-2092

Reply via email to