[Mimedefang] Wiki updates
Philip Prindeville
philipp_subx at redfish-solutions.com
Thu Apr 6 14:07:02 EDT 2006
Steffen Kaiser wrote:
>You match the TLD agains $ccpat.
>
>BTW: I don't remember where, but there is perl FAQ with entry like "how
>can I check if a value is part of an ARRAY?", the answer is like "if you
>need to ask this, you certainly have used the wrong data structure and
>should use an HASH. Otherwise use foreach()".
>I'd say you should do the same and use HASHes instead of ARRAY and regex.
>
>Bye,
>
>
Ok, it's been tweaked.
I've changed @bad_countries to a hash, and I've changed @bad_tld's into
a hash
as well (I probe it with the RHS of the hostname from longest to
shortest, stripping
off the left-most component until there's only one component left).
Anyone else have any comments about the example or the strategy?
-Philip
More information about the MIMEDefang
mailing list