Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

chrimble (2034)

chrimble
  (email not shown publicly)
http://chris.carline.org/

Journal of chrimble (2034)

Wednesday November 05, 2003
06:10 AM

Template Toolkit

I've been using Template Toolkit for the past two or three years now, and it is truly a marvel. But yesterday, I was asked by a coworker if it was easy to include a datastructure dump in the output containing all variables passed to a template object in the process call without having to do anything reciprocally to the back-end code (for the purposes of debugging). I wasn't sure, but it didn't sound too unreasonable, so I said I'd take a look.

After trundling through the documentation, getting unhelpful advice on IRC (shock horror!) and finally delving into the stash and poking around a bit, it became apparent that lots of things become intermingled in the generation process that I hadn't previously appreciated (leading to potentially unexpected results such as perl -we'use Template; Template->new->process(\"c:[% component %] f:[% foo %]", { component => "oops", foo => "bar" })'). So at least the short answer to the question would appear to be "no".

Of course, a solution involving embedding perl stash traversal code directly into the template or even writing a template plugin would be doable at a push, it's almost certainly not worth doing if you have access to the back end code.

Thursday July 24, 2003
05:46 AM

Class::DBI

I've been having a great time playing with Class::DBI these past few days. Although I've been vaguely aware of it for a while, I hadn't really considered using it till I read Kake's article on perl.com, and realised that it might be suitable for use in the project I'm currently working on (which had until that point used a more traditional vanilla DBI implementation).

Talk about straightforward - it took about two minutes to set up, and it all worked first time. If only everything were that easy. ;-)

There are only two things I still need to work out before I'm completely happy.

Firstly, it doesn't seem to want to play nicely with Apache::Reload, at least at first glance. So I'm back to an apache stop/start cycle, at least whenever I update the database declarations. Knowing me, I'm missing something blindingly obvious, but it'd still be nice to sort it out. Though in the grand scheme of things, it's really not that big a deal.

The second issue is that I currently don't know exactly how much performance overhead it incurs, so I need to write some benchmarks. Whilst I have a feeling it's going to be quite a bit (considering what it does), I want to know exactly how much, as compared to plain DBI. OK, yeah, premature optimisation and all that, but it'd be nice to know what to expect before I start hammering it for real. ;-)

Wednesday June 25, 2003
09:36 AM

Batik Rasterizing

SVG is great fun. Gone are the days of faffing about in the Gimp trying to make consistant-looking buttons for my website - now it's simply a matter of knocking out a quick script that outputs some appropriate SVG ready for conversion into a bitmap format.

For that purpose, I use the batik rasteriser. Whilst it's java-based and no speed demon, it produces some nice output, and it's fairly easy to get good results. Unfortunately, it also requires a connection to an X server as it relies on the AWT for some of its functions - even the command line tools such as the rasterizer. Nothing appears on the screen - it just needs the X connection otherwise a fatal exception is raised.

So I've been down a merry "xhost + [machine]" route whilst setting the DISPLAY environment variable to point back my workstation from the development box (no X). This is officially Inconvenient, and I've been grumbling about it for a while. The previous official "solution" to this problem was to set up xvfb and use that. Again, Inconvenient.

Happily though, today I found a proper solution. Java 1.4 has introduced a "headless" mode which can be activated by adding a simple "-Djava.awt.headless=true" flag to the java call that runs the rasterizer. Yay!

So I thought I'd put it here in case I needed to remember it again. ;-)

Monday February 17, 2003
12:25 PM

SVG. Pfft.

I've been working on a system that draws pretty graphs using SVG (via SVG.pm). And I've reached the point where the output is really quite nice.

The only black cloud on the horizon is that I have to incorporate the generated graphs into a Word document. Rasterizing the graphs looks really ugly, and whilst generating larger-than required images and scaling them down provides acceptable results when printed, the on-screen display is terrible.

I've therefore spent most of the day trying to work out how I can convert my SVG images to something like EPS. In theory, it should be possible, but in practice? Not on your nelly.

At least, not on *my* nelly.

I've tried Batik, ImageMagick, Ghostscript... All come to naught, in one way or another. I'm really not sure what to do now. I suspect it might be back to the drawing-board, so to speak...

SVG is pretty nice to play with though - at least, when you don't have to incorporate output into anything else... 8)

Monday February 03, 2003
05:50 AM

Curses

Currently trying to get my head around Curses::UI at the moment, and am feeling slightly flummoxed as a result.

I think I prefer Curses::UI as compared to Curses::Widgets, as it seems to work slightly better on my terminal, or at least the demo scripts do, and there seems to be slightly more documentation available for it.

I just wish I was slightly more clueful in this area and was more confident that I was heading in the right direction.

Thursday December 26, 2002
09:12 PM

Perl and MacOS X

As I continue my gradual acclimatisation with MacOS X, I find that I've done certain things that now I wish I hadn't. Chief amongst these is stomping over the default Perl 5.6.0 installation with 5.8.0.

With retrospect, this probably wasn't a terribly bright thing to do. I could restore 5.6.0, but as I've only just got my mod_perl (with AxKit) setup working nicely I really don't want to go through the rigmarole of re-diddling everything to work in separate areas.

Oh, but for the want of a little foresight...

Tuesday December 17, 2002
07:59 AM

Ok. Here we go.

Well, whilst I already keep an online journal of sorts over here, I don't really have anywhere appropriate to blather on about perly stuff (however tenuous the relationship). So I'll try sticking it here, and see how it goes.

Not that I have anything particularly to mention right now of course, but "one step at a time" and all that.