O'Reilly Network    
 Published on O'Reilly Network (http://www.oreillynet.com/)
 See this if you're having trouble printing code examples

Big Ship, Many Geeks

Article and photos by Tim Bray

The ship is big and white. Really big. It has over a thousand passengers, about half that many staff (and we learn on the bridge tour that it takes only five people to drive), 18 bars, three restaurants, two swimming pools, a casino, a spa, lots of shops -- you get the picture.

Larry Wall and Tom Christiansen on the cruise.

Larry Wall and Tom Christiansen on the cruise. (Click on photos for larger views)

About 10% of the passengers are geeks. Specifically, Perl geeks. This, the first in a planned series of Geek Cruises, is the Perl Whirl -- seven shipboard days and nights from Vancouver up to Alaska and back, with plenteous lectures centering on Perl but branching out into XML, JavaScript, Apache, the Document Object Model, and so on.

  1. Connectivity's poor. You can get Internet access of a sort for $3.95/e-mail or 60 cents a minute. Telephone calls are $7.95/minute (that's not a misprint). Cellphones don't work. Pay phones and Internet cafes in the Alaskan ports of call are mobbed by geeks and boat staffers alike.
  2. The latest Perl (5.6) has real file-handle variables, just like every other programming language in the world. You can open a file and get a scalar variable (with a $ on it) and pass it to a subroutine:
      open($fh, "<foo");
      $l = readline($fh); # like <>
  3. You could, if you wanted, spend your entire time on the cruise ship eating. Weirdly enough, something about being in a boat makes you (well, me, anyhow) hungry all the time.
  4. Perl is making a heroic effort to Do The Right Thing with Unicode, while at the same time allowing people who want to use their primitive native encodings (examples include 11-bit ones-complement Malayalam and US-ASCII) to ignore it. So far, it seems not only to work but have good performance.
  5. They say that cruising is a pastime of the elderly. This is not entirely fair; while many gray hairs are to be seen, there are a substantial number of young people who are not Perl geeks.
  6. Apache 2.0 is introducing new and non-backwards-compatible internal APIs for C-language modules. Much gnashing of teeth is expected.
  7. This ship (the MS Volendam, and MS doesn't stand for anything in Redmond) is part of the Holland America Line, so the officers are (mostly) Dutch, while the bulk of the staff are Filipino and Indonesian. There seem to be some rules in place that divide the jobs between those done by Filipinos and those done by Indonesians. We don't know what they are, but the staff are awfully nice.
  8. Perl 5.6, which seems like generally a very good thing, currently doesn't work in a mod_perl (i.e., Apache) context. This is a big problem for some people.
  9. White snow against blue sky in Glacier Bay

    White snow against blue sky in Glacier Bay.

  10. Alaska's snow-capped mountains shout ecstatic white against the bright-blue sky; no cruise-ship paint will ever approach it. We're told it rains a lot here, but as far as we can tell, this is a pack of lies put out by Alaskans trying to deter cruiser-trash; we see nothing but sunshine and balmy warmth.
  11. On the subject of phenomena that defy conventional wisdom, it should be noted that there is apparently coherent logic, and even real utility, behind Perl's dreaded globs and typeglobs. You want two names for the same datum? No problem! This doesn't mean I'm going anywhere near them.
  12. Whales, bears, and eagles appear obligingly to entertain the geeks; Randal Schwartz's Web-publishing talk is greatly disrupted by a gleaming black whale (an orca I thought, but others say a bowhead), breaching and caracoling gaily down the side of the ship.
  13. The XML dump of the Open Directory (see http://dmoz.org/rdf.html), 580 meg in size (this week), contains about 275,000 topics whose names add up to about 19 megabytes. With Perl 5.6, on a 64-meg Win98 laptop, you can not only load these into an array and sort it, you can even use them to key a hash (the values are offsets, of course) without totally wiping out Windows. Not half bad at all.
  14. Larry in one of his aggressively-styled tuxedos.

    Larry in one of his aggressively-styled tuxedos.

  15. Pre-cruise, we anticipate conflict between the ship's occasional demands for formal dress at dinner and the geek anti-haberdashery ethos. It turns out that Larry Wall is an avid collector of gaily-colored tuxware (he brought 3), that Tom Christiansen looks good in basic black, Dori Smith (JavaScript goddess) has a nice lineup of long dresses, and that the geeks rise to the occasion with a considerable amount of panache.
  16. Irritatingly, XML::Parser, which brings James Clark's formidable and speedy expat into Perl's ambit, runs slow. Too slow, in fact, to be useful on things like the Open Directory data. For things of that scale, you need to use the good old regexp engine. This should be fixed.
  17. You sit at the same table for dinner each evening in the main restaurant. We were fortunate enough to end up sharing with some amusing linguistics pedants (barbs such as "mere folk etymology!" are hurled freely), so that was fine. I guess if you ended up with weenies, you could eat at one of the many other eateries.
  18. If you think it's nice that brute-force hashing of Open Directory topic names works, but are worried about this scaling as the data keeps growing, there's a trick where you can (in Perl) retrieve the contents of any topic in under a second, with an index that requires only 4 overhead bytes per topic. The implementation is left as an exercise for those readers not fortunate enough to have been along on the cruise.
  19. This must be important or real or something. There's a writer from Wired here, a whiff of saturnine/ursine SanFran style among the geeks and the cruisers.


  1. These days, there's a trailing 'x' modifier that makes Perl ignore white space in regular expressions, allowing you to write things like
    next if (m{  <p[ >]  # need to catch both <p> and 
                         #  </p class=
               | <h\d    # all headers
    Not bad, eh?
  2. If we hit an iceberg, a certain Northern California publishing house that puts animals on book fronts is going to be in deep trouble; the headcount of major-animal-book authors on board is pretty high.
  3. Geeks viewing glaciers; note Larry's fashionable glacier-viewing attire.

    Geeks viewing glaciers; note Larry's fashionable glacier-viewing attire.

  4. Speaking of nice regexp tricks, you can now use paired delimiters, allowing flights of poetry such as
    s {java} <perl>x;
  5. It's pretty nice paddling around in a nice warm swimming pool in the sunshine, watching big snowy mountains and glaciers drift by the windows.
  6. All is not 100% well at the top of the Perl community. Certain key figures seem not to be talking to certain other key figures. Having said that, the technology rolling off the assembly line still looks pretty good.
  7. In Skagway: jeeps, houses, mountains.

    In Skagway: jeeps, houses, mountains.

  8. The food is good and plentiful, but pretty bland. On this Pacific-Northwest cruise, there are no microbrews and not a decent latte to be had. On the wall of a (very good) Tex-Mex place in Juneau, the sign advertising the local brew says "The Envy of Heineken."
  9. You can do nice efficient readable things with Perl's for controller:
    for (@lines) { $_ .= "\n"; }
    is the inverse of
    for (@lines) { chomp; }
    The trick is that for sets up $_ in a nice way.
  10. The cruise line has photographers everywhere, taking shots of passengers arriving and in their formal duds and of Perl geeks with the assembled speakers. Then they sell you prints. I bought three.
  11. You don't need to loop to use for to set up your default variables; consider:
    for ($episode)
      # $_ is now an alias for $episode, so...
      s/\s+/ /g;
  12. Tidewater glacier in Glacier Bay.

    Tidewater glacier in Glacier Bay.

  13. The ship spends a day in Glacier Bay, floating gently up almost to the scarred and melting faces of a couple of big tidewater glaciers; the passengers cheer the chunks of ice that break off in the sun with a splash and roar. This could be described as "awesome" were that word not so cheapened.
  14. If you really want to take for to the max, you can do things like for (@new = @old) { s/bad/good/g; } It does just what it looks like it does, but I don't understand why. By the way, quite a few of the examples here are, uh, adapted, with thanks, from Tom Christiansen's presentation materials. If you go hear him speak, you'll write better Perl.
  15. I brought tons of reading material, but between going to the talks, attending the endless captain's receptions and Geek-Cruise events, looking at the landscape, and hanging out in one of the 18 bars talking about technology, I got through damn little of it.
  16. Sailing away from Skagway at dusk.

    Sailing away from Skagway at dusk.

  17. LWP is the best-known Perl module for talking to the Web. It has grievous problems in the areas of time-outs and input throttling, and furthermore it's big and very hard to understand. Sometimes, it's not worth using. However, it's not 100% clear that Perl's core interrupt/alarm handling is going to get out of the way enough to fix the problems. Also, Gisle Aas, its author, seems to have a new job, and it's not clear what LWP's future is.
  18. You can have a more intense technology experience than you get on a Geek Cruise and at the same time save quite a bit of money and some wear and tear on your cardiovascular system from rich food and booze. Even so, I think the future of geek cruising is rosy; it's a pretty seductive package.

Tim Bray is the Founder and CEO of Antarcti.ca Systems.

Discuss this article in the O'Reilly Network Forum.

Return to the O'Reilly Network Hub.

Copyright © 2009 O'Reilly Media, Inc.