[Bristolbathpm] web.py in perl?

Nigel Hamilton nigel at turbo10.com
Tue May 27 14:21:44 BST 2008


Hi,

Here are some modules that do the trick for me:

DBIx::Simple [1]
============
I use DBIx::Simple to talk to the database because of its brilliant 'query'
method --- which sums up the whole philosophy of the module ....

                         $db->query(<<ANY_SQL_HERE)->what_you_want_back();

The query() method lets you do anything with the database and ask for
anything you want back --- it assumes the programmer knows SQL and otherwise
keeps out of your way. If you're comfortable with SQL then DBIx::Simple is
worth a look.

Template::Simple [2]
===============
The flipside of the database input problem is how do you get data out? I've
always thought there should be "no code in the template" - as it adds
another layer of complexity and processing. So when Uri Guttman bellowed "No
Code in the Template!!" during a lightning talk at YAPC::NA I sat up in my
chair [3].

He described an elegant module that in 300 lines of code solved 99.9999% of
the templating problem. Despite the audience groaning, "not another
templating module," I could see this module was an improvement on my
homegrown module so we sponsored Uri to release it to CPAN as
Template::Simple.

Web::Simple [4]
============
As for a web framework I think less is more here too and I'm interested to
see HTTP::Engine on  CPAN. There is currently no Web::Simple on CPAN but
something could potentially fit in with HTTP::Engine to provide just a web
context with internal Request / Response objects (e.g., Servlets). I'm
imagining a minimal module that is framework-agnostic. At the moment we use
a homegrown pure-Perl webserver[5] and a very simple WebContext to bind
requests and response - it works well in combination with DBIx::Simple and
Template::Simple.

Just some ideas for the meme pool ...

NIge

p.s. looking forward to having a pint tonight

[1] http://search.cpan.org/~juerd/DBIx-Simple-1.32/lib/DBIx/Simple.pm
[2] http://search.cpan.org/~uri/Template-Simple-0.02/lib/Template/Simple.pm
[3] http://www.sysarch.com/tiny_template/slides/index.html
[4] Imagine-ware
[5] Sparky - http://blog.thegoo.org/2006/02/sparky-powering-goo.html
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.bristolbath.org/pipermail/bristolbathpm/attachments/20080527/81a47237/attachment-0001.html 


More information about the BristolBathPM mailing list