The Problem
Your web application's search engine claims a HTML document matches your query. But your HTML highlighting feature (similar to Google's Cached display) fails to highlight the query in the document. Your web browser's "find" feature can locate and highlight the query just fine.
The Solution
Get HTML::HiLiter from CPAN.