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


In reply to Re: What was the bait (project, problem or opportunity) that hooked you on Perl? by Old_Gray_Bear
in thread What was the bait (project, problem or opportunity) that hooked you on Perl? by generator

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.