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



_______________________________________________
NOTE: If there is a disclaimer or other legal boilerplate in the above
message, it is NULL AND VOID.  You may ignore it.

Visit http://www.mimedefang.org and http://www.roaringpenguin.com
MIMEDefang mailing list MIMEDefang@lists.roaringpenguin.com
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang

Reply via email to