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.