State of the Onion, and screen savers

The State of the Onion #8: Larry Wall's "State of the Onion" speeches are always really entertaining: they're nominally about the current state of Perl, but really they're about all kinds of things. The latest one was mostly about his recent health problems, but also about community, cognition, and design. This time, instead of slides, he ran screen savers and related the behavior of each to what he was talking about.

[BSOD]
This particular screensaver fools me more often than I care to admit. The problem is that the more computers you've used, the more different kinds of crashes you've seen. And mentally, you classify them all in the "Oh, shit!" category, which is a category the brain is very efficient at processing.

On the other hand, the part of your brain that says "Hey, that's the crash screen for a different operating system, dufus!" -- that part operates at a much slower pace. The brain is chock full of shortcuts, and orthogonality be screwed. Optimizers cheat, and sometimes they get caught cheating. With this screensaver, you can catch your own brain's optimizer cheating.

Tags: , , , , ,

perl and unicode go together like apples and razor blades

That scrmable thing has really been making the rounds: I've seen the text translated into three or four other (human) languages now, not to mention all the people writing their own scripts in their marginalized geek-language du jour.

But my script was malfunctioning for a bunch of people, and I finally figured out why. Fucking Unicode again. If $LANG contains "utf8" (which is the default on recent Red Hat systems), then "^\w" doesn't work right, among other things. Check this out:

    setenv LANG en_US
    echo -n "foo.bar" | \
    perl -e '$_ = <>; print join (" | ", split (/([^\w]+)/)) . "\n";'

          ===> "foo | . | bar" (right)

    setenv LANG en_US.utf8
    echo -n "foo.bar" | \
    perl -e '$_ = <>; print join (" | ", split (/([^\w]+)/)) . "\n";'

          ===> "foo.bar" (wrong!)

It works fine in both cases if you do $_ = "foo.bar" instead of reading it from stdin.

perl-5.8.0-88, Red Hat 9. Hate.

Tags: , , , ,