If you use HTML::TokeParser::Simple, just pass a reference to the variable to the constructor.
use HTML::TokeParser::Simple; my $parser = HTML::TokeParser::Simple->new(\$html); my $new_html = ''; while (my $token = $parser->get_token) { my $text = $token->as_is; $new_html .= $token->is_text ? munge_text($text) : $text; } print $new_html; sub munge_text { # put your text munging stuff here }
Cheers,
Ovid
New address of my CGI Course.
Looking for work. Here's my resume. Will work for food (plus salary).
In reply to Re: Manipulating plaintext within HTML
by Ovid
in thread Manipulating plaintext within HTML
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |