pQuery is the pragmatic port of the jQuery JavaScript framework for Perl, which you can use to clear the screen.
pQuery is pretty sensitive to garbled HTML. Consider the following example:
use pQuery;
my $html_malformed = "<html><head><title>foo</title></head><body>bar</body></html>>";
my $page = pQuery($html_malformed);
my $title = $page->find("title");
print "The title is: ", $title->html, "\n";
pQuery will not find the title tag in the above example due to the double " >>" in invalid HTML.
To make my pQuery-based applications more tolerant of distorted HTML, I need to pre-process the HTML by clearing it before passing it to pQuery.
Starting with the code snippet above, which is the most reliable clean perl way to clear HTML code to get it to parse: is pQuery possible?
source
share