On Thu, 6 Apr 2006, [EMAIL PROTECTED] 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
_______________________________________________
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 [email protected]
http://lists.roaringpenguin.com/mailman/listinfo/mimedefang