Beefy Boxes and Bandwidth Generously Provided by pair Networks
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
in thread Code and html separation - always or mostly doable? by kiat

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (5)
As of 2024-03-28 13:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found