04 February 2005

Ok you geeks, I hate to admit it, but, much to my chagrin, I've discovered that Perl is fun. I just used it to parse a file (much like a .htaccess file) containing "username:encrypted_password" and test to see if the username was the same as the (unencrypted) password. (and no, i'm not breaking into anything, i'm supposed to be the admin for the system in question)

What astonishes me is how easy it was. It didn't take much work at all, and as I learn more about perl, I see how I could have done it even easier with built-in shortcuts and regexps.

The reason I'm astonished is because I used to hold a strong prejudice against perl. For those wondering why level-headed me would be so prejudicial, here's a bit of sample code I randomly grabbed from here
$drw =~ m/.*exception occurred:.*?pid=(\d+).*?\s+\1\s(.*?)\n/s;
Yeah. That's not real pretty. Perl jockeys seem to love code like that, and, quite frankly, it scares me. (and no, I still am not quite sure what that line is doing). Anyway, who knows? Maybe I'll be writing stuff like that in a few weeks. I kind of hope not.

No comments: