While arrays are ill suited for this, there are several ways:
if (grep /^\Q$a$/, @set) { ... }
But more likely, you'll be better off using a hash instead of an array. Then, it's trivial (and fast!) to do this:
if (exists $set{$a}) { ... }
-- Dan
In reply to Re: Set Operators
by zigdon
in thread Set Operators
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |