Posted on 2005-02-28 16:59:16-08 by ovid in response to 161
Re: Author and Maintainer

Hi Rich,

Try as I might, I can't quite figure out what you're trying to do here, but taking a stab at it, it seems like you're trying to strip HTML tags from the "selector2.txt" file? Is this correct? If so, a simple way of stripping tags from a chunk of text would be to do this:

use HTML::TokeParser::Simple 3.13; my $parser = HMTL::TokeParser::Simple->new(string => $html_text); my $text = ''; while (my $token = $parser->get_token) { next unless $token->is_text; $text = $token->as_is; }

At the end of the while loop, $text will contain only the visible text from $html_text. If this does not answer your question, try explaining the following four things:

1. What you are trying to do.
2. How you are trying to do it (with the smallest possible code snippet that shows the problem.
3. What results you expect.
4. What results you are getting.

Direct Responses: 164 | Write a response
Perl Weekly newsletter
A free weekly newsletter for people who are busy to read all the blogs. click here to check it out.