I have frequently found myself in a position where I want to treat an array as a set, and wish there were "set operators" (or wish I knew if they existed) in perl. The main thing I want to do is test to see if a scalar is a member of a set that is inside an array. I.e.
if ($a isamemberof @set) {...}Does anyone know a 1 line way of checking for set membership like the above? Thanks for the help, Monks.
MarkIn reply to Set Operators by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |