> Use grep:
> 
> @colors = ('red', 'yellow', 'green');
> $var = 'green';
> print "yep" if grep /$var/, @colors;

On second thought, this answer is not ideal in your simple case. This checks
every element and is really oriented toward regexes.

The hash method is probably your best bet.

- Mark.

_______________________________________________
Perl-Unix-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to