[Mimedefang] Wiki updates

Matthew.van.Eerde at hbinc.com Matthew.van.Eerde at hbinc.com
Thu Apr 6 04:05:47 EDT 2006


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;

...

if ($bad_countries_hash{$cc}) { ... }




More information about the MIMEDefang mailing list