Welcome to the Monastery | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
kiat, I've been using HTML::Template for about 6 months now. Before that, it was all Here documents, which made it impossible for my designers to do any editing (can't expect graphic designers to learn Perl). And now, through experience and a little creativity (loops nested 3 deep which has forced me to master AoHoA....'s) I've been able to move all Perl-built HTML strings out of my Perl and into my HTML.
Do I truly have HTML separated from code (code equaling logic)? Not if you consider H::T 'code', which you often because of conventions like conditionals and loops. So, I haven't really completely separated code from HTML. My designers still have to deal with some level of 'code' when editing the HTML. Thought the use of comment tags and carriage returns between H::T and HTML, it's a little easier to read. Because I have moved to all CSS-tableless XHTML 1.0 strict for my HTML, I can't validate my code in BBEDIT because it stumbles over all the H::T stuff. A bit frustrating (of course, it can all go in comment tags, but the doc warns of bandwidth problems, so eventually it gets stripped out.) One thing I have improved on is using nomenclature that helps tie my MySQL tables to the loops in my HTML, so column names equal loop names. In summary, I'm pleased with H::T and now that I'm building CMS apps, I find it indispensible. And in combo with Perl, it sure beats the ASP alternatives. kiat, it's been interesting to read your nodes over the past 9 months. It sounds like you and I are on parallel tracks (though you are a couple of lengths ahead of me) and doing very similar work. Thanks for all your great questions—I have learned a lot in following them. Good luck. —Brad "Don't ever take a fence down until you know the reason it was put up. " G. K. Chesterton In reply to Re: Code and html separation - always or mostly doable?
by bradcathey
|
|