the hypothetical maximum data transmission rate of a telecommunications medium

Posts Tagged ‘perl’

Reflections on the Perl6 logo

Posted by dlandgren on 2009-09-26

She: Oh… uh, isn’t that new?
He: Yes it is. Do you like it?
She: Well… what is it?
He: Uh… “New Young American Primitive”.
She: I have a new young American sister. She’s only three and her stuff is really primitive.

—Joan Chandler and John Dall, Rope (Alfred Hitchcock)

It would appear that Larry Wall has (his heart) settled on a logo for Perl6, and he’s been thinking about it for quite some time.

I would also like to make it clear that I’m a just a little tired of these “rounds”; more importantly, that I’ve been mulling over this particular issue for many years.

Which brings us to:

Does the flap of a butterfly's wings set off a tornado?

Does the flap of a butterfly's wings set off a tornado?

Woah, my eyes, talk about Angry Fruit Salad. Of course, this comes from the man who considers chartreuse to be a suitable background colour for a web page…

There is a textual representation of the logo as well, and in fact, it’s only after seeing the text version that the above makes any sense at all:


Or if you have Unicode and decent typesetting software:

typographical perl6 logo

Now the meaning becomes clear, it’s meant to be a riff on Perl6’s hyper-operators. Well, fair enough, but really, those bug eyes, that crooked smile, the P and 6 in the wings, that’s supposed to be what? And what will that look like to a colour-blind person? Is this a peculiarly American need, to have a mascot? I’m baffled.

But seriously. In the 10th State of the Onion, Larry suggested that Perl 4 was a pre-teen, and Perl 5 was an adolescent. Perl 6 is when Perl grows up and becomes an adult. And the language is coming along nicely. There are lots of lovely features going into that is going to make it a fascinating language to work in over the next couple of decades. And now this curiously infantile regression.

The biggest problem is that I would have a hard time advocating the language without people snickering at me. I am reminded of Jamie Zawinskie, when he announced his resignation from Netscape, some months after the company was bought out by AOL.

…someone from the New York Times asked me what it would be like working for AOL, given that they represent (in her words) “all that is cheesy and mainstream about the net.” She asked if AOL had lost that stigma. I disengaged my brain and answered,

I think AOL still has all the stigma that it always has, as far as image goes. My friends keep saying jwz@aol.com and then laughing uncontrollably…

I envisage a conversation at work when I would suggest that Perl6 would be a secret weapon that would boost programmer productivity and give us the edge that allows us to roll out new applications faster and better, and the other people in my team rolling their eyes and laughing. “Hey guys, let’s break out the acrylic paints and do some fingerpainting!”

The language scene is a lot more crowded these days. Perl is going to find the going a lot harder this time around. Not to mention the rise of worse is better and the likes of PHP.

I can’t see how this is going to help matters.

I just can’t take any of you seriously
Fire up the batmobile, ’cause I gotta get outta here …

—Liz Phair, (Fire Up The) Batmobile

So please, anyone, anywhere, come up with a better one, before it’s too late, ok?


Posted in perl | Tagged: | 9 Comments »

Using Perl to scan a Lotus Notes database quickly

Posted by dlandgren on 2009-04-22

I had a couple of hundred messages lying around in the depths of my work e-mail account. They were old Majordomo subscribe/unsubscribe alerts for a mailing list I managed (until we switched over to Mailman). I had kept them around because one of these days I figured I’d load the information into a database to track the evolution of the subscriber base.

I haven’t managed to get around to doing that yet, but I did want to get rid of the messages. All I needed was the subject line of the mail (which contained all the necessary info) and the date the message was received. The idea of doing it manually would have been a nightmare. I searched around a bit for a way of automating the task, and discovered that it could be done through OLE.

So I wrote a quick Perl program to do it. It went like this:

use strict;
use warnings;

use Win32::OLE;

my $Notes = Win32::OLE->new('Notes.NotesSession')
    or die "Cannot start Lotus Notes Session object.\n";
my $db = $Notes->GetDatabase("MyServer/MyDomain", "mail/mymail.nsf")
    or die "Could not open database.\n";
my $all = $db->AllDocuments;

foreach my $n (1 .. $all->Count) {
    my $doc  = $all->GetNthDocument($n);
    my $item = $doc->GetFirstItem('Subject');
    if (!$item) {
        warn "doc $n has no subject\n";

    my $subject = $item->{Text};
    next unless $subject =~ /^(?:UN)?SUBSCRIBE my-mailing-list/;
    print $doc->GetFirstItem('DeliveredDate')->{Text}, " $subject\n";

and presto, the deed was done. This saved me I don’t know how many hours of mind-crushingly boring and RSI-inducing cutting and pasting. It’s so trivial it’s not even worth bundling up, so this is probably the best place for other people to stumble across it in a search (hi!).

I’m not sure if Strawberry Perl is bundled with Win32::OLE, but this works straight out of the box with ActivePerl.

Posted in perl, programming | Tagged: , | 8 Comments »