in reply to without looping, check if $var is found in @list
For common approaches see the faq.
Update
Perl 6 will provide the any junction, which you can play with using the Perl6::Junction module for now.
use Perl6::Junction qw/ any /; if (any(@list) eq $var) { }
|
---|