Dag Ågren, also known affectionately as "WAHa.06x36", is the author of PerlHP.pm, a module that allows you to write Perl that looks like PHP, or as he puts it: "is it the other way around?"
1. So firstly, what's with the pseudonym, WAHa.06x36?
Long story. The basics go like this: I'm a big fan of 2channel-style message boards. 2channel () is the world's biggest online forum, even though it is mostly limited to Japanese users. The board software uses no user accounts, and encourages posting anonymously. However, for those times when you actually need to prove your identity, there's a system called "tripcodes" you can use. The idea is that you can attach a password to your name, and this gets hashed (with good old unix crypt()), and the hashed value is shown. So theoretically, unless you know the password, you can't use someone else's tripcode. Of course, in practice the security isn't all that high since the algorithm is well known. I was playing around with that algorithm, and thinking that it'd be cute to use no name but only a tripcode that spells out something. I generated a whole lot of them and grepped them for something interesting, and ended up with "WAHa.06x36". Why this is actually interesting is another, even longer, story.
Incidentially, I've written some re-implementations of 2channel-style message boards, which are in use on various sites, such as http://www.4-ch.net/, an English-language message board.
2. I suspect there is another long story behind one of your more infamous creations: PerlHP. The word is it was meant as a joke, yet it has already been used in some serious projects.
Maybe not quite as long, and I've forgotten the exact details, but it was the confluence of several different things:
First, once upon a time I tried using PHP3, and decided that I really liked being able to embed code in HTML to quickly create pages, and I also like the effortless handling of query variables and cookies as global variables. However, I didn't care much for the language, which felt clumsy and unrefined. Later versions of PHP, in their urge to make the language grow up into a real programming language, started dropping the things I liked about the language, such as the globals. I thought this was pretty silly.
Second, I had been studying the silly Perl code produced by people like Mark Jason Dominus and Damian Conway, especially Lingua::Romana::Perligata. That way, I learned about Perl source filters, and thought there should be some fun uses for that.
And third, someone on 4-ch.net (there it is again) suggested a programming contest with the simple aim of seeing just what you can implement in 4k of code, in any language. The two earlier issues combined in my mind, and I got the idea to take the parts of PHP that I liked, but replace the language with Perl, using a source filter. It turns out this was fairly easy to do, and fit in well under 4k of code. The fact that there is quite a bit of animosity between PHP and Perl fans is what made it so funny to me - I figured it would be confusing and annoying to anyone on either side of the debate who had strong opinions on the languages.
Incidentially, one reason I like Perl is that you can really write what amounts to a joke in it - not a program that does something funny, but a program that is funny in itself. This appears to be only possible in certain languages, and Perl is among the best for it. Mark Jason Dominus' "Perl Stupidity" () page has some great examples.
3. I know what you mean about the competiveness between the languages. I dug up a quote from someone on the use.perl.org message boards: "a Perl version of PHP would render PHP obsolete." That sounds almost wishful. With the recent release of PHP 5, and Perl 6 on the way (not to mention Ruby), where do you see the market share heading for scripting languages?
I'm really not sure. I like Perl, of course, and Perl 6 looks like it will bring even more of the kind of craziness I like about the language, if it is ever finished. I never tried Python, being turned off by the whitespace sensitivity and such, but it doesn't seem all that popular for web apps, but more popular in other areas. Ruby looks promising, but isn't there yet. PHP 5 is the kind of thing that makes me think that if you want a real programming language, why not use one of the other ones that already exist? PHP is popular with inexperienced programmers, and they're not going to care about the more refined features.
PHP's big advantage is really that it has so much stuff compiled in by default (I particularly like the inclusion of SQLite in PHP 5). Lots of users don't have control over their web host, and can't install additional modules. This holds back the other languages in relation to PHP. I often try to avoid using CPAN packages for code that is meant for lots of people to use for this reason - if I depend on a module that is not installed by default, a whole lot of people will simply not be able to use my software.
4. Programs that can interpret themselves, of which PerlHP is a perfect example, are pretty hard to explain to people. How would you describe this feature of Perl?
Sorry, not entirely following the question.
Yeah, that may prove my point -- it is hard to explain. But the way Filter::Simple works is by taking what would normally be the "code" of the program and parsing it up and evaluating according to new rules. You're allowed to effectively reinvent the language syntax if you wish. How significant do you think this feature is?
I think it's a very good fit for Perl, which never does things quite the way you're expected to do them, but maybe not so much for a more traditional language. I understand tcl can do similar things, but I've never tried it.
Of course, part of the reason Perl can do this is because it's so powerful at parsing. In most other languages, it would be a major pain in the ass to do. I hear Perl 6 is going even further, and I'm really interested in seeing what that will turn into.
5. I've always viewed PHP as a templating tool that just got way out-of-hand. But Perl already has several well-established templating systems available: Template Toolkit, HTML Template, and many others. In your mind, what makes PerlHP worth using over any of those other guys?
As I mentioned before, I try to design code that doesn't have external dependencies. PerlHP.pm is a single pure Perl file, and can be dropped in together with your PerlHP files. This makes it usable on a lot more systems, where you don't have access to install third-party modules. Of course, any other module that is pure Perl can do the same, as long as it doesn't have non-standard dependencies, but for most of them, this is not a priority.
Most other templating kits also require a lot more glue code and bother. PerlHP just lets you get away with being much lazier. This is good for small and some medium-sized projects. For a larger project, I'd still use another kind of templating library, since the simplicity of PerlHP might get in the way more than it helps in that case. I have one of those of my own too, but it's not really something I've released for public use, although the source is available together with some of my other apps.
6. Frameworks seem to be the Big Thing right now--I'm thinking of Catalyst, Rails and Prototype, as examples. To me this says developers see value in redefining how the interact with their languages. PerlHP certainly changes how web pages are "usually done" in Perl. Could it be a model for how Perl and web pages are built in the future?
I don't really think so. Having written a bunch of web apps really from scratch, I know this quickly becomes a huge chore. New ideas are definitely needed, but I don't think PerlHP goes quite far enough. For small projects, it's quite good, but for a large project, you need something more radical. I haven't really tried out any of the popular frameworks, but from what I read I'm not sure if they go far enough.
I basically have this nagging feeling that programming languages could evolve much further than they have already, but are being held back by a lack of imagination. I can't really blame anyone for this, though, because I can't think of what needs to be done either.
7. Finally, are you really advocating the consumption of human flesh, or was that whole business just a "misunderstanding"?
Certainly everybody agrees that this is not acceptable behavior in today's society! However, morals change - these days, women are allowed to vote, slaves go free, and religious tolerance reigns world-wide, so it is not beyond the realm of possiblity that one day the taboo on eating human flesh will also be a thing of the past!
Actually, I'm suddenly very glad to be a vegetarian! Thanks for your work on PerlHP and the rest of the software you've contributed to the community. And thanks for taking the time to answer my questions.
