Personally, I don't like the whole idea; when I'm building a template I don't want to be bound to the formatting and syntax of the output. That IMO only works well when you have really simple substitutions. Then again, I don't like
HTML::Template either. :-)
Anyway, there already is a template module CPAN that, as far as I can see, does what you want. See HTML::Seamstress.
updated: punctuation.