> it's not a matter of "popularity" -- it's a matter of being horrendously
> difficult to support.
I grant from what I've seen of PMS that this gets pretty ugly. Or at least
it seems to to me, but then a lot of apparently good Perl looks pretty ugly
to me. ;-) But I'm a C++ and Algol programmer, so the whole structure
looks kinda odd to me. :-)
That said, if I understoood enough about objectable Perl to safely do any
coding in it, I'd be perfectly happy to make something do this. This would
come close to 'trivial implementation' in C++, and I'd hope it really isn't
all that much harder in Perl.
I brought this up now because there is talk of changing the structure of
things, and it seem to me that compiling the rules down into a class of
their own that could potentially be subclassed might be the clean way to
deal with a lot of the stuff that looks ugly now.
>From reading through pms, there just doesn't seem to be all that much there
that absolutely *has* to be ugly, and ugliness (at least in my experience)
is usually a sign of an incorrect structural or algorithmic decision at the
outset, and trying to force the code into a structure it doesn't like. Of
course, the initial design decisions always seem good at the time; its only
after you don't want to touch the code anymore does it start to become
obvious that there should be another way, whether there is or not.
There are a lot of things I'd like to see done with rules to make rule
writing both easier and more productive, and I;ve been trying to come up
with a structure that conveniently supports all the things I'd like to see.
A few of the more obvious:
1. User rules handled efficiently
2. Counting rules
3. Chained re's
4. A simple algorithmic form of rule so you don't have to write an eval or
plugin to do something simple
5. Reloading the rule base without having to restart SA
6. Rules with scores based on number of hits (variation on counting rules)
7. Short circuiting.
I just have this feeling that with the right structure a lot of this will
fall out as no-brainers. Witrh the wrong structure a lot is difficult or
impossible. I know how I'd do it in other languages. The question in my
mind is whether any of those techniques convert to Perl. I guess I'll
either have to learn enough Perl to answer that myself, or be able to spend
an hour or two bouncing ideas off someone that already knows Perl.
Loren