12.10
I’ve been being a lurky lurker here for ages so I figured it was about time to flood bfish with a Sutcliffe braindump. Prepare for comments, posts ‘n’ stuff.
I’ve been setting up a website for me and Mike to do political discussion and media analysis on, where we release a set of articles every two months (I think). I’ll let him tell you more about what it’s about, I just wanted to talk about the technologies I’m using.
As I didn’t want to use anything but Perl, I went looking for a Perl CMS and found HTML::Mason, a group of modules for building dynamic HTML (or any text format) without using CGI directly. It’s a templating system and more; basically it allows you to embed Perl code in your pages in much the same way that you do with PHP. Each page is a “component,” which can have arguments, attributes, methods, subcomponents and can inherit from other components. These things are specified in, to pick one example, <%args>…</%args> sections. Perl code is embedded <% … %> in tags, or on lines beginning with a %, or in <%perl>…</%perl> sections, and you use <& … &> tags to call other components. I loves it. Plus, it makes page caching and session cookies a piece of piss.
Using Apache’s SetHandler directive and mod_perl’s PerlHandler directive in your httpd.conf or .htaccess file, you tell Apache to handle requests for your top-level components using Mason’s handler. There are many, many other Perl templating systems available, which I wasn’t aware of when I started using Mason, but I’ve taken a look at the popular ones (Embperl, Template Toolkit, Catalyst), and none has the same combination of syntactic grace, ease of deployment and power as Mason. Of course, with that power must come a bigger overhead, but I’m not too worried about that.
Also, you web-developing people probably know about this, but (might know about Mason too, but what the hell) I’ve also become aware of Prototype, a system for dynamically generating Javascript code for AJAX, seemingly without having to know any Javascript, which is handy. It can be used from Perl, Ruby (where it originated) and probably others.
Still clinging on to Perl then… Perl doesn’t fit in my brain anymore…
I’ve been working for a while now with Servlets/JSPm but for small scale stuff it’s often overkill.
I’ve been meaning for a while to have a look at RubyOnRails – since I know lots of people who rave about great it is.
Clinging on? Psshh. I stand defiantly atop its lofty peaks.
Perl’s fine – but me and Perl don’t get on these days. I’ve been corrupted by Java I suppose.
I should really learn a scripting language properly. I get by with bit’s of bash here and there, but it annoys me that I don’t really know what I’m doing.
Any suggestions?