[Mimedefang] Wiki updates

Steffen Kaiser skmimedefang at smail.inf.fh-bonn-rhein-sieg.de
Thu Apr 6 07:52:41 EDT 2006


On Thu, 6 Apr 2006, Matthew.van.Eerde at hbinc.com wrote:

> Steffen Kaiser wrote:
>> 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.
>
> Something like
>
> my %bad_countries_hash = map { $_ => 1 } @bad_countries;

or

my %bad_countries = map { $_ => 1 } (

qw( ............... )

);

In order to avoid the conversation each time the function is called.

Bye,

-- 
Steffen Kaiser



More information about the MIMEDefang mailing list