No such thing as a small change | |
PerlMonks |
Temporarily strip HTML (solved!)by epoptai (Curate) |
on Jul 20, 2002 at 00:54 UTC ( [id://183517]=note: print w/replies, xml ) | Need Help?? |
Despite the title of this reply i'm still interested in any more guidance on how to do this properly. Since jeffa asked, this problem involves giving framechat the ability to translate the chatterbox in real time using babelfish.
I couldn't figure out how to implement an HTML::TreeBuilder solution so i went with DamnDirtyApe's code because it works and resembles the way i had tried and failed to solve the problem. His example works as posted but had problems when tested in the wild. So it evolved into the following working example. Two problems: i had to use two global variables, and the links break sometimes when the translation mixes up the order of the html placeholders. Testing with the live chatterbox today revealed that the second problem is relatively rare, but i'm still thinking about how to prevent it. This test script translates a small sentence of English into a random European language while preserving the HTML: Thanks to everyone who replied to my original query!
--
In Section
Seekers of Perl Wisdom
|
|