I keep meaning to learn some of the various templating modules, but I've never had the downtime to mess with them. It's the way I learned to do things, I prefer having the extra control of exactly what gets sent. but well, I tend to go the hard coded route. So yes, there are times when there are advantages to not hard coding your HTML. (loop through, find right item(s), and add the extra code). Some of the potentially most annoying bits in generating HTML are the putting in selected/checked attributes on form inputs. There is also the advantage that you can remove highly repetitive tasks. (well, it's still a good idea to validate your HTML). You also have the advantage that Perl will generate syntax errors if you don't have matching parenthesis, rather than needing to check the HTML afterwards.
(which is why there's 4.0 transitional, and 4.0 strict) If you have the extra layer of encapsulation, you can do checking, to make sure that the values are valid, and that you're not using tags that you're not supposed to. The big problem, with the change from HTML 3.2 to HTML 4.0 was that a bunch of tags were deprecated. Now for the question, why use functions to create everything? I don't know for everyone, but I think part of it is a historical thing - there was a time when HTML was in flux, and new versions were coming out. (but you're not using the OO syntax, so let's get to the other part). The OO implementation is may be faster than the function calls. Well, I think this is actually two questions - why use CGI to dynamically generate HTML, rather than hard coding your HTML, and second, why use the OO interface to CGI, rather than the function calls.