What version of HTML::TokeParser and HTML::Parser do you have? This works:
my $html = '<font class="copy">Name<br />Address<br />Country</font>'; my $p2 = new HTML::TokeParser(\$html); while (my $token = $p2->get_tag("font")) { my $text = $p2->get_trimmed_text("/font"); print $text; }
That prints Name Address Country.
Also note that HTML::Parser parses texts in 512K chunks. Is there a possibility that your actual program is hitting this barrier? See the $parser->unbroken_text method in the HTML::Parser docs.
Cheers,
Ovid
New address of my CGI Course.
In reply to Re: Using TokeParser with embedded tags
by Ovid
in thread Using TokeParser with embedded tags
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |