in reply to What was the bait (project, problem or opportunity) that hooked you on Perl?

My very first exposure to Perl was my boss wandering into the cube and asking me to help him figure out what wasn't going on in his code.

We were running a Mail Transfer Agent written in Perl 5.005--; a Perl 4.x application that had been "converted" to Perl 5.x by changing the shebang line and praying a lot. We had a spammer hitting us, and Tomaso, after talking to the Vendor for a couple of hours had found a hook that could be used to add User Code in a callback.

The code was getting called, but his regex wasn't working. We spent and hour or so with me playing Socrates ('what does this set of characters do? Are you sure, might it not be doing that?'). We ran through a quart of coffee before we finally had something that would black-hole some of the spam some of the time. It was running about 20% false positives, so we had to monitor the 'black-hole' file and re-inject the valid messages into the stream below our hook.

I spent the rest of the afternoon curled up with Tomas' copy of the Llama Book (second edition) and about 2200 I came up with an index() and substr() solution that seemed to produce fewer false positives.

The following morning we took another quart of coffee and romped through my 'solution' and decided on the basis of "it's easier to read, it's got fewer statements, so it ought to run faster" to try in out over lunch.

I crashed the MTA at 1201 (I said is was a Perl4 app....), but we figured it out and brought the Mail System back up around 1345. And we started seriously black-holing the spammer, (success!!) and only two false-positives in the first hour. We shipped both code-fragments back to the Vendor for review. They cleaned them up and added them to the User Contributed Routines of the next release.

I spent my spare time during the next three weeks reading the Llama (twice) and the man()/PerlDoc. It's been all down hill from there....

----
I Go Back to Sleep, Now.

OGB

  • Comment on Re: What was the bait (project, problem or opportunity) that hooked you on Perl?