http://bugzilla.spamassassin.org/show_bug.cgi?id=2987
------- Additional Comments From [EMAIL PROTECTED] 2004-05-10 23:50 -------
agreed that local/net should be in Conf, not on the commandline btw.
IMO, a good way to do this would be to separate the code from that gigantic if {
} if { } if { } block, by doing something like this:
=item POD for option
blah blah
=back
{
setting => 'required_score',
priv => 0,
dflt => 5,
validate => \&is_integer,
code => sub {
my ($self, $setting, $val, $line) = @_;
$self->{$setting} = $val;
}
},
[ ... other settings... ]
Pros:
- Since the "priv" member would model if the setting is privileged or not, we
can then move them around without worrying about that.
- Since the string "setting" is static, we can very efficiently parse the config
by doing string compares on that instead of REs.
- There's no function call overhead until the correct entry has been found.
- we can move the default setting to that block, near its POD doc.
- we could even split it into multiple POD files/modules if that is desirable.
(I think it may be, to be honest; one for Bayes, one for defining rules, etc.)
- note that 'validate' provides a way to share validation code.
- note that the "code" block above is highly generic and could probably be the
default for most settings, something like how 'validate' is dealt with.
However, we should probably still special-case the settings ("body", "describe"
etc.) that occur most frequently, for speed.
--j.
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.