HTML::RewriteAttributes is designed for simple yet powerful HTML attribute rewriting, by simply specifying a callback to run for each attribute. This module is designed to be subclassable to make handling special cases eaiser. See the source for methods you can override.