use strict; use warnings; use List::Util qw(first); my @questions = ( 'a' .. 'z' ); my $column = 'q'; if ( first { $column eq $_ } @questions ) { print "'$column' is in <@questions>\n"; }