in reply to Customizing WWW::Mechanize

when an HTML entity has been encoded twice (e.g., & ...)

Kind of an off-topic reply, but please note that sometimes this is not an error. I ran into this very thing with my website. I had similar code in place to check for double-encoded entities, but it falsely triggered when I actually wanted &amp;amp;, for instance if I wanted to have &amp; rendered in the HTML output (without resorting to tricks like PM's <code> tags, or similar).