Slashdot Mirror


Embed Perl With Mason -- Read All About It

autarch writes "Embedding Perl in HTML with Mason, written by Ken Williams and me, is now available at booksellers of distinction. Mason is a Perl-based templating system and application framework. The book covers Mason from the basics on up to extending the Mason core with your own subclasses. For more details check out our web site and the O'Reilly site. The latter includes the TOC and a sample chapter."

3 of 37 comments (clear)

  1. Not a paid endorsement by jslag · · Score: 3, Interesting

    I just spent 12 months developing a reasonably complicated website/webapp for my organization, using mod_perl & HTML::Mason. I wholeheartedly recommend Mason for perl-savvy web developers; it does a really nice job of providing powerful tools without creating a steep learning curve. As long as you know perl, of course. Very snappy performance, to boot. I should probably buy a copy of the book as a 'thank-you' to the writers, who, in addition to their substantial coding work, are timely and helpful on the relevant mailing lists.

  2. Re:Readability? by glenstar · · Score: 3, Interesting
    It's not confusion so much as just how, um... unpleasant the code looks. Using code delimeters like <% is bad enough, but with Perl you end up with lots of $, %, etc... to *me* very, very unreadable code. So, to answer your question: I am not a Perl fan. At all. That being said, I prefer templating languages that allow for very clean separation of logic and HTML (as one example, look at Skunkweb, skunkweb.sourceforge.net)... then again, I am a Python bigot.

    Just my opinion. Like I said in my original post, I think that the concepts behind Mason are very valid and well implemented, I just dislike the templating language.

  3. Template Toolkit by tezza · · Score: 3, Interesting
    I don't use Mason. I use Template Tookit.

    True separation of business and display logic.

    Do all your processing, calculating, searching, formulating, control flow in perl with no HTML to be seen. Whack all your data in a hash. Pass said hash to Template->process(). Then any [% variable %] text in the HTML looks in the hash. Every web designer worth their salt can deal with that. What is great too is that [% %] comes as ordinary copy in Dreamweaver et alia. They can see where it's going to go. This has its limitations though. Some designers don't grasp the concept of dynamically generated hidden fields to pass variables in a session stack. They tend to omit important tracking stuff.

    Also Templates [TT2 being the favourite] will generate your emails. Combined with the rather strenuous Text::Autoformat, you get freakin' nicely formatted text emails.

    --
    [% slash_sig_val.text %]