It had been a while since I played Perl Golf. Today someone posted a mini-golf problem in the fwp mailing list, and since I woke up very early in the morning (4am) I decided to have some fun with it.
Given two strings $x and $y we have to put in $n the index of the first character where they differ. If the strings are equal $n has to be undef. For example, if $x is "foo" and $y is "foobar" then $n has to be 3.
I sent a few solutions and by now the shortest one is mine (with a fix pointed out by Yitzchak Scott-Thoennes):
It's a pity playing golf requires so much effort to squeeze a solution until you get something more or less good. It remembers me to how work with koans is explained in books (I have never worked with koans myself), you visualize your solution and try to improve, change, explore other approaches, consult the documentation to take advantage of corner cases, try to gain some character via some side-effect, reordering, think, think, think, ..., you have to be one with the problem, so to speak. Takes time, concentration, and it's very intensive. Solutions often come by saturation. Otherwise I would play more frequently.