my $sep = "\x01"; my @list = ('jumping turtle', 'frog!', 'tad?pole'); for my $var (@list) { if (index(join($sep, '', @list, ''), "$sep$var$sep") >= 0) { print "Found $var\n" } else { print "Didn't find $var\n" } }