in reply to better way to find list members?

Here is an answer to your question, which makes use of that high-utility CPAN module, Quantum::Superpositions:
use Quantum::Superpositions; use strict; my @ary = (1..7); my $testnum = 4; if ($testnum == any(@ary)) { warn "$testnum is a member"; }