use String::Approx qw(amatch);
open(DICT, "/usr/dict/words") or die "Can't open dict: $!";
while(<DICT>) {
print if amatch("balast");
}
ballast
balustrade
blast
blastula
sandblast
Options passed to amatch control case-sensitivity
and the permitted number of insertions, deletions, or substitutions.
These are fully described in the String::Approx documentation.
The module's matching function seems to run between 10 and 40 times
slower than Perl's built-in pattern matching. So use String::Approx
only if you're after a fuzziness in your matching that Perl's
patterns can't provide.