#!/usr/local/bin/perl -w
#
# nobug.pl -- demonstrates absence of bug with API version 3
#

##
## Main
##

use strict;
use HTML::Parser ();

my $p = HTML::Parser->new( api_version   => 3,
			   unbroken_text => 1, 
			   text_h        => [ 'bug', "self, text" ]);

$p->parse_file("problem.html");

##
## HTML::Parser
##

package HTML::Parser;

sub bug {
    my ($self, $text) = @_;
    
    print STDERR "$text\n----- END CHUNK -----\n";
    @_ = split(/\W/, $text); ## no problem!
}

