On 11/22/2010 09:02 AM, shawn wilson wrote:
any of y'all write web apps in perl? what do you use? i'm using
html::template but i was thinking of going back to straight cgi.pm or having
my perl send back json for the page to render (but i'm not that familiar
with js). thoughts?


Your major unwritten question seems to be "should I render the site on the server and deliver that, or deliver the parameters and let the browser render it" -- In my arrogant opinion, that technology is not yet ready for prime time.

Yes, you can use that technique to excellent effect in improving overall user experience -- get 90% of the content out inside the <html> quickly and then fill in some of the personalized details after document.onload with some JS bits and bobs. While it may take no less real-time for the entire page to complete rendering, users consistently describe the experience as being more responsive.

As an experiment in minimalism, on a lark, my team delivered a page where the body was LITERALLY:

<body></body>

And then filled in the entire page piece by piece with a series of XMLHttpRequest calls, each chaining to another to fill in another bit of the page. It was fun to watch, but having a content-free document get searched and indexed was a non-starter for a "public facing" web site.

For web sites we use Mason ( http://masonhq.com/ for all the beautiful details ) which plays nicely with mod_perl.

For web *services*, it's all about writing a mod_perl ResponseHandler producing whatever makes sense for the application at hand. For those things that demand XML, I'm a big fan of XML::LibXML -- a set of perl wrappers around the fast and complete libxml2 project from the Gnome people ( and their XSLT engine as well )

For most of our sites, clients now want some amount of Ajaxy tintinabulation and cantination so for those we have a synthesis of the two above techniques: A handler near the root of the site that takes a JSON parameter block on an HTTP POST transaction and returns more JSON or maybe even the output of running a mason component. (Note that getting mason components to run inside an apache but outside of their own RequestHandler was a painful experience and some functionality I still haven't mastered ...)

Ten years ago I used Embperl a lot for doing web sites.

Five years ago I picked up some work for a client that had a dozen sites that were coded with HTML::Template, and I have to say: Of every templating system I've seen, it stands out feet and ankles below all the rest. It's flow control and parameter passing were as near pessimum as I can imagine.

Building a site with here docs and CGI seems to me a horrible experiment in masochism - if you want some pointless exercise in managing minutiae take up a hobby like needlepoint or building a working DTL model of a Pentium processor out of 2N3904s and 1N914s.



--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to