my %lookup = map { $_ => 1 } @a;
There is no need to put values in the hash.
my %lookup; @lookup{@a}=();
Futhermode if @a is holding a set of data that is not conceptually ordered it is better to simply use a hash and not an array in the first place.
In reply to Re^2: boolean IN(); function in perl like
by nobull
in thread boolean IN(); function in perl like
by Frank John
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |