if ($var=~ m/@list/ ){ print 'ok'; } #### #!/usr/bin/perl -w use strict; use warnings; my @list = qw(frog turtle tadpole); my $var = "turtle"; if ("@list" =~ /\b$var\b/) { print 'yup'; } # using quotes, we coerce the array to act as a string else { print 'nope'; }