use String::Approx qw(amatch); my @list = qw(Apple Pear Orange); my @inputs = qw(aple appe peay range oranges mango appple aqqple); for my $word (@inputs) { if (amatch($word, ["i"], @list)) { print "Matched: $word to ??
"; } else { print "Unmatched: $word
"; } }