(NOTE, 2016-03-03: I’ll probably have to re-check the factual accuracy of this blog post at some point. Automated conversions, weird data massage beyond my control and Drupal have done some damn interesting things over the years. Kids, smart quotes and coding don’t mix. Mysterious document mangling and pretty-printed code don’t mix.)

I’ve tried to get better at using email, now that I have some people who actually write to me.

And part of that thing is that I’ve realised that email signatures are pretty useless. Email has become a more personal communication tool and as such everyone already has my contact details. Email signatures were also used in Usenet (and I made my best effort to keep them up to the standard), and since I no longer really read Usenet at all and newer message board thingies don’t give damn about these specs, the point is moot.

So I no longer sign my emails. But I just updated the email signature anyway - just as an exploration of old stuff and see how it works. I’d like to share a tale about an old signature thing that I originally did in 1999 and have updated a few times since. Just for the interests of general geekery and explaining a few historical trends.

So here’s how the epic new signature looks like:

What? What? It looks like a complete mess when pasted to the blog, even if I use the correct code. sigh truly, this thing is a relic from the past. Okay. Here’s a frigging screenshot.

(Update, 2013-10-22: Drupal’s input parsers seem to totally fuck this up even further, so I’m not even bothering to try further. So screenshot it is!)

(Update, 2016-03-03: Fear the night, for JekyllRB is here.)

$_=';~=?%?%=*?;[%=;~;_;_;%%==?&~&_=?;}=+=?&~&^&;=?&~=?[[[=&}[;&%[==^=?%;&{&}
&^&[[*=?%* |||  Urpo Lankinen             aka WWWWolf         ||| *?;_;%%;;}
;_;%%*=?&[ ||  wwwwolf@iki.fi      http://www.iki.fi/wwwwolf/  || &%[;=?%[;%
;}%=;      | writer, programmer, artist, geek  |    @wwwwolf    |    ;=^?]';
 tr/?~=*;%&[{}]+_^ (),.:@\/\n0-9!|a-zA-Z/0-9acde/d; $_=pack("H*",$_); print;

I just realised this is 5 lines instead of the regulation 4 lines, but in ye olde days I had a version with only 4 lines, so it’s quite possible to cram all this information in 4 lines and have a working computer program in it.

“Wait, what?” you ask. “A working computer program?”

Yes!

Here’s what happens when you save the piece of code in a file and run it in Perl interpreter:

% perl evennewersig.pl  
A PR0GRAMMER am I, and a writer. Things S0METIMES get WEIRD.

Yeah. It prints out a piece of text.

And most programmers at the time just said “where the fuck did that text come from?”

Let me explain this thing point by point.

If you split it command by command and reformat it, the program actually looks like this:

$_ = ';~=?%? ... ;=^?]';  
tr/?~=*;%&[{}]+_^ (),.:@\/\n0-9!|a-zA-Z/0-9acde/d;  
$_=pack("H*",$_);  
print;

Looks significantly easier to digest now, doesn’t it, but still bloody impossible to read unless you know some Perl. So further explanation is necessary.

The first line assigns the most of the stuff into the default Perl processing variable $_. “We have a bunch of stuff”, says the programer, “and we’d like to operate on that.”

The second line replaces a whole bunch of special characters with numbers and letters. Specifically, it does this sort of transformation:

?~=*;%&‌[{}]+_^
0123456789acde

The following characters are thrown away:

(),.:@/0-9!|a-zA-Z

…and spaces and the returns.

In other words: Certain rare punctuation is replaced with numbers 0-9 and A,C,D,E. Common punctuation, whitespace, and actual letters and numbers are thrown away.

Then comes the third command, which interprets this string of 0-9 and A,C,D,E as a whole bunch of hexadecimal values.

Which is a sequence of bytes.

Which contains a message.

Which is then printed out, come the fourth command.

So essentially, all that garbage you see in the signature, adorning the rims, is actually data to be processed. The human-readable parts are thrown away.

This was my attempt at “Just another Perl hacker” thing. I think it worked out, even if I refused to make the program actually print out “Just another Perl hacker”. =)

Here’s the nasty thing, though: I had a good reason why byte values containing hexadecimal digits B and F are not allowed in the string (which means I can’t use characters like O (0x4F), o (0x6B) and k (0x6B) and which is why the output says “PR0GRAMMER” and “S0METIMES” with zero instead of O, oh the ugliness), but for the life of me I can’t remember what it was. It was probably just that I ran out of usable punctuation that’s commonly available for use in signatures. But why B and F? I honestly have no idea. This is what happens when you don’t comment your code.

So what’s the problem with the signature? Programmers found it cool. Others found it quite confusing.

Also, email has changed. Usenet signatures were 4 non-wrapping text lines printed with monospace font. People use proportional fonts in modern email apps and discussion forums and signatures are no longer that well confined to those specs. Netiquette has changed from strict specs like this to informal agreement of “just try to keep it short, okay? Don’t try to be one of those morons who use gigantic images as their sigs.”

And, of course, we must not forget that the security considerations aren’t what they used to be. Back in the day, it was quite one thing to use actual executable or interpretable code as pieces of stuff to be exchanged. Now we really need sandboxes at least, or use non-executable formats whenever possible. It’s kind of silly that we need to put hard security constraints on things like this, but that’s just how it is. No one would actually try to run those signature programs, but hell, you never know. =)

So I suppose this should serve as some kind of a harebrained and not particularly informative decipherment of one old hack of mine. I can’t remember if I wrote anything about it before, but here were some notes and what happened back then. My Perl skills are a bit rusty (owing to the fact that I do Ruby more these days), but hope this was adequate.