Mojolicious has its own templating language -ep- which is basically Perl itself.

I was also a big fan of Template Toolkit, and still use it on occasion. Yet I hardly ever use it for web templating anymore, because ep is so flexible. It is also nice to have one less dependency in the mix.

I highly recommend that you spec out the app as suggested, but would encourage you to favor building interfaces as collections of dynamically generated 'widgets' rather than monolithic pages. Having to work on a few such monstrosities I can tell you that the pain of 'just one change' becomes:

  1. change the template
  2. fiddle with the javascript
  3. muck about with your objects/backend code
  4. resist the urge of self-defenestration

I won't even mention how bad it becomes when there are database changes as well.

Think of parts of your page as widgets (or boxes, cartons lol) whatever. Decompose the interface into many pieces that can be generated independently. Then the 'just one change' might actually be small enough to just require one of the steps above, and probably not the last one.


In reply to Re^2: Need generic advice on how to use modern perl for building webpage and which modules should be installed. by Ravenhall
in thread Need generic advise on how to use modern perl for building webpage and which modules should be installed. by Perl300

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



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.