#! perl use strict; use warnings; 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) { my @matches = amatch($word, ['i'], @list); if (@matches) { print "Matched: $word to: ", join(', ', @matches), "\n"; } else { print "Unmatched: $word\n"; } }