>>>>> "RBAK" == Roger B A Klorese <rogerk@QueerNet.ORG> writes:
RBAK> Sounds like perl is kinda crippled in this regard, then; couldn't sed
RBAK> or awk do it?
I don't think so. Perl can _if_ you slurp the header all into one string.
Assume you don't. So you see the Subject: header and you have to return
either yes or no, right them. But you haven't seen the From: header yet,
so you really don't know. You have to look through until you see the from:
header, then reconcile what are two separate matches.
Now I didn't pull everything into a single string because Mj1 didn't; for
some reason I also thought that it would let someone suck down all of your
RAM by sending you a big header. Then again, the MIME modules stuff the
header in memory anyway, so perhaps it's not an issue. I'll think about
what it would take to do it; it would certainly speed up a few comparison
loops.
RBAK> Show me all users on the list with To: containing "att." unless To:
RBAK> contains "worldnet.att.net". That is, all AT&T subscribers who are
RBAK> not Worldnet subscribers.
But there aren't any 'headers' involved; the 'To:' is anomalous. Just a
generic 'containing blah unless containing hurl' makes much more sense for
that application.
To see why this doesn't really map onto regexps well, try translating
something as simple as "contains abcdef and contains ghijk". Order matters
to regexps, so you need the awkward /(abcdef.*ghijk)|(ghijk.*abcdef)/. The
complexity increases exponentially from there.
Perhaps perl5.005, with all of its new regexp goodies, has some features
that would help here. I don't pretend to even understand them all, though.
It may be worth it to make this feature conditional upon perl5.005 if
indeed there is something there that will help.
- J<
Follow-Ups:
References:
|
|