Thanks! I agree, and separating my code from the presentation is exactly what I am trying to do. I basically wrote my own template library, so now I am just trying to clean that code up a bit. After I posted I dug a little harder and found that you could use HTML::TreeBuilder/HTML::Element (push_content) to create HTML documents as well. But I took a look at CGI:HTML as you suggested and it suggested HTML::Tiny, and that looks exactly like what I am looking for. In my application in some places I also generate HTML and then use HTMLDOC to convert it to a PDF, so this will come in handy there as well.