Slash Boxes
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 ]

blech (1597)

  (email not shown publicly)

Journal of blech (1597)

Thursday March 25, 2004
05:18 AM

pydoc as a web server

Simon Willison's weblog recently pointed out that the Python documentation tool, pydoc, could be used as a web server:

Simply type the following at the command line:

pydoc -p 8888

Then point a browser at http://localhost:8888/ to browse interactive documentation for every Python module available on your system.

Is there any reason why such a tool couldn't be made for Perl? What about one relying on only core modules, such that it could go into the core? The main questions I'd have would be the state of pod2html, and how to get a web server without relying on CPAN.

Anyway, it's an idea that might be worth embracing and extending.

Wednesday August 27, 2003
06:36 AM

My First Module: File::Type

I've finally uploaded a module to CPAN.

File::Type uses magic to find out the type of a file, like file(1). Of course, the observant will point out that this merely duplicates the functionality of File::MMagic (and, the eager CPAN watcher will note, File::MimeInfo).

However, there are a couple of problems with both of those modules. File::MimeInfo doesn't use magic at all yet, but merely glob patterns. It also doesn't ship with the magic file it references.

File::MMagic is the canonical solution to the problem, and it does include a magic file (inlined into itself). Each time File::MMagic is run, it recreates the rules it needs to match by parsing that inlined magic. This means it uses seeks within a __DATA__ block, which causes problems within mod_perl. File::Type, by contrast, uses a seperate module (File::Type::Builder, which is included in the distribution, as is a magic file) to generate Perl code which is then included in File::Type itself. This means that the module can be very simple indeed, and it's safe to use under mod_perl.

However, as the version number should warn you, File::Type is still quite young. While it creates a few hundred rules from the magic file, there are still a hundred or so that it ignores because I haven't written the code generators for their pattern types. It's fine for many types of file (as the included tests show), though.

After releasing the main module (and the obligatory 'doh, need to bugfix' release), I thought it'd be fun to see if I could make an equivalent to File::Find::Rule::MMagic, which adds the ability to filter File::Find::Rule searches by mime type. It appeared on CPAN as File::Find::Rule::Type yesterday evening.


Thursday July 24, 2003
11:32 AM

MP3s and Perl- a talk

Well, as promised in my last entry, I've given a talk on 'Managing Digital Music Collections with Perl', after having crash-tested an earlier (not significantly different) version on at the technical meeting last Thursday.

Both times it went reasonably well, and although I get fewer laughs today I was happier with how I presented it. There was a little gentle ribbing about my choice of mp3s on IRC, it seems, but that's fine; I knew they were a little rubbish.

Afterwards, davorg mentioned that he, too, had thought about (and in his case started writing) an easier tagger that doesn't require knowledge of id3v2 tags. After I persuaded acme to write MP3::ID3Lib in January, I always meant to work on a nice wrapper, but never did get round to it (partly because I'm still having problems with compiling the library on Mac OS X). I suppose that's back on the front burner, as it were.

Also under consideration is MusicBrainz. It's showing a lot of potential (more so than my never-released FreeDB noodling) but there are still a couple of gaps. I'm not over-enamoured with the reliance on a C library, either; my old Mac OS heart beating still. I'm starting to think about how to use it directly. It doesn't look too hard. (Famous last words?)

In any case, now it's over, you can read the slides (and notes (which need work), and code (which mainly works)), and I can think about the speaker's dinner and doing a writeup of the rest of the conference tomorrow.

Thursday June 19, 2003
04:16 AM

Digital Music talk at YAPC::EU

Once I send the acceptance email, I should have a slot at YAPC::Europe, talking about "Manging Digital Music Collections with Perl", or "id3: how you hate it but can't live without it", as it should really have been subtitled.

So that's a month in which to make my code look pretty and then write about it. It's a good thing I cunningly took a week off to get the bulk of it done, really. Oh, and that I have a digital music collection to manage, but that's hopefully universal enough to interest people.

With that, essuu organising the hotels (thanks!) and a ticket to ride on the shiny Eurostar TGV, things seem to be set fair for Paris.

Monday February 03, 2003
12:07 PM

Pith, a nice Safari add-on

Earlier today I found a strange little app called Pith, which provides a floating window menu for Safari. Now, that doesn't sound very impressive, but given that it hides when Safari isn't frontmost, and that it's fairly configurable (you can change how it orders windows, and whether it shows up in the Dock) it's damned useful.

However, Tom really found it useful when Safari crashed and it maintained his current window state, so he could recover his session. Also, for those of you who like tabbed browsing (and no, I don't) there's an option to open windows within the same frame (which I haven't tried).

Like PTHiTunesNotifier, it's a sign of how far you can get with a decent IPC mechanism (in this case, AppleEvents). And, of course, Perl can speak them too, directly or via AppleScript. Which is nice.

Wednesday October 30, 2002
01:14 PM

Election fever

Well, it's a year since I became's leader and that means it's time to get a replacement elected. The rules are very similar to those davorg used last year, but with a slightly less stringent nomination procedure and a small change to make sure all the candidates are human. Sorry, Amelia.

I do wonder if I shouldn't have used this journal more for leadership things. I've been fairly quiet on list, too, although those of you on IRC will have seen the grumpier, angsty, decision-making me as well. At least people like Trelane and acme have documented technical and social meetings even when I haven't. On the other hand, I'm not sure I've found any great insights into leading a PM group, following on largely from davorg's excellent start. I've not had to face too many hard choices, and our problems now mainly stem from the large numbers of people on list and at meets, something I'm sure a lot of other groups envy.

In any case, it's been an interesting 11 months, and here's hoping the final month or so of my leadership passes easily enough.

Thursday September 05, 2002
11:17 AM

Mindless OS X link propagation

I don't usually just post links to use.perl; there's scribot for that. But given how Mac OS X seems kind of popular around here, I thought the excellent Ars Technica review of Mac OS X 10.2 deserved a bit of plugging here.

Oh, and for the record, that vote for Mac OS? It was me. I'm still way too attached to the old Finder to leave, even though 10.2 does address some of my problems with the new Workspace. Sorry, Finder. :)

Thursday August 22, 2002
04:15 AM

RSS Feed Collation

Way back in July, there was a fairly big thread ensued on use.perl about people leaving, and keeping track of their journals. In the wake of that I knocked up a bit of code that visits a site, reads the RDF feed, and generates a listing a lot like the use.perl friends page. (Note that RSS 0.91 feeds are a bit useless, as they don't have time metadata. More on that later.)

I've been prompted to revisit it because is looking at how (and whether) to revamp the site, and it struck acme that maybe collating people's journals would be a good idea. It turns out that plugging the RSS feed of this journal into the CGI works fine, except it doesn't have a timestamp on the entry. (Pudge? Please? :) In any case, hey presto, instant community content!

In a similar vein, I've seen an interesting collection of blogs on, which instead of presenting snapshots of entries like my code does, provides a chronology of updates. This is also pretty nifty.

Friday June 28, 2002
08:39 AM

YAPC::NA 2.4- context, cpanplus and conversation

I thought there should be some more context for the last post, which was the edited quotes from the movie gnat shot. That was the context. There do seem to be plans to post it online at some point, and I recommend you watch it.

I spent a good hour in Jos Bouman's CPANPLUS talk. It was quite amusing how some of the issues that started the whole CPANTs drive have been solved already, to some extent, by the project, and how some of the other queries around it were general packaging queries. I'm really looking forward to the 0.4 release, which seems to have a lot of really nifty goodies in it, most notably (for me) the packaging tools, which will hopefully let people who want to use their distribution's packaging tool as much as possible do so happily.

Once hachi had emerged from the Perl6 BOF dha, DrForr and I got our lift to the barbeque |siv| was hosting at his house out in the 'burbs. There didn't seem to be that much Perl talk going on, but I did kick about a 'soccer' ball for a bit (handy hint: this is not good in the humidity and heat of St Louis), listened to gnat and pudge play guitar in the garden, talked to various people about travel experiences, cloverleafs, accents, smoking, reunions and of course beer. (Someone managed to bring some Young's Chocolate Stout and another beer- from the US, I think- I forget the name of which really impressed the locals.)

In any case, it was a good party- the social highlight so far by far- and I seem to be doing well so far in hangover taming...

Thursday June 27, 2002
05:29 PM

YAPC::NA 2.3- lightning movie

Unicode, a strapping hunk of manhood, testosterone crazed loons and being fondling, he ate me, cartoon porn and collectible card games, checks are for farmers, I came to realise it was a joke, a max_int number of monkeys, uri is scary, singularites in the code space continuum, backports to Perl1, look at the error message! the error message is GOD!, Perl can do everything. Guess you did get the YAPC thing down.