use List::Util 'first'; print "OK\n" if defined first { $test == $_ } (7, 5, 3);