For similar functionality with what I consider a cleaner interface and neater structure see HTML::Mason module review at www.masonhq.com. (I realize the author mentions it, but I wanted to make the plug more prominent and provide links).
It can intersperse code and HTML (or whatever language, it is not tied to HTML, it could spit out text, XML, ASP, gifs, jpegs, you name it...). And it has an interesting component structre where each file is considered to be a component (whether or not it can be called externally) and components can call each other so you can make widgets that take arguments in mason as well as the top-level components that get called directly. Also it has a neat object-like hierarchy where you can define a method call to generate the page framework (a top, bottom and side for instance) and then all the other pages need to do is output the appropriate content for the content area. The sub-pages can override the methods of the lower-level pages to customize the way things display.