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}) { ... }

_______________________________________________
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