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:
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.
I have no idea the mechanism by which your text is being altered in the Web page output because what you are printing to the file is the same thing you're printing to the Web page. You appear to be using Mercantec SoftCart and they appear to be intercepting your requests and interpreting the information. Thus, by the time your script is done printing, the interpolated information is not yet present. This is not an HTML::TokeParser::Simple issue as the requisite data is not there to parse. I would recommend contacting your vendor for a solution.